%I #12 May 27 2024 07:28:07
%S 1,0,7,4,3,4,5,2,7,2,3,4,11,3,5,2,3,2,7,3,9,4,3,2,5,2,5,4,3,4,7,2,7,2,
%T 3,4,5,3,9,2,3,2,11,3,5,4,3,2,11,2,7,4,3,4,5,2,5,2,3,4,7,3,9,2,3,2,5,
%U 3,9,4,3,2,7,2,5,4,3,4,7,2,9,2,3,4,5,3,5
%N a(n) = min{k : KroneckerSymbol(n, k) = 1} if n > 1 and k > 1, a(0) = 1, a(1) = 0.
%C The Kronecker symbol only takes the values -1, 0, and 1. One can ask about the first appearance of these values in the rows of the square array K(n, k) with n, k >= 2, and supplement for boundary values n, k = 0, 1. Answers can be found in A373088 (case -1), A020639 (case 0), and in this sequence (case 1).
%p K := (n, k) -> NumberTheory:-KroneckerSymbol(n, k):
%p a := proc(n) if n < 2 then return 1 - n fi;
%p local k; k := 2;
%p while true do
%p if K(n, k) = 1 then return k fi;
%p k := k + 1;
%p od; -1; end:
%p seq(a(n), n = 0..86);
%o (SageMath)
%o def A373180(n):
%o if n < 2: return 1 - n
%o k = 2
%o while True:
%o if kronecker_symbol(n, k) == 1:
%o return k
%o k += 1
%o return -1
%o print([A373180(n) for n in range(87)])
%o (PARI) a(n) = if (n < 2, 1 - n, my(k=2); while(kronecker(n,k)!=1, k++); k); \\ _Michel Marcus_, May 27 2024
%Y Cf. A372728, A373088, A020639.
%K nonn
%O 0,3
%A _Peter Luschny_, May 27 2024
|