login
A373180
a(n) = min{k : KroneckerSymbol(n, k) = 1} if n > 1 and k > 1, a(0) = 1, a(1) = 0.
2
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, 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, 3, 9, 4, 3, 2, 7, 2, 5, 4, 3, 4, 7, 2, 9, 2, 3, 4, 5, 3, 5
OFFSET
0,3
COMMENTS
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).
MAPLE
K := (n, k) -> NumberTheory:-KroneckerSymbol(n, k):
a := proc(n) if n < 2 then return 1 - n fi;
local k; k := 2;
while true do
if K(n, k) = 1 then return k fi;
k := k + 1;
od; -1; end:
seq(a(n), n = 0..86);
PROG
(SageMath)
def A373180(n):
if n < 2: return 1 - n
k = 2
while True:
if kronecker_symbol(n, k) == 1:
return k
k += 1
return -1
print([A373180(n) for n in range(87)])
(PARI) a(n) = if (n < 2, 1 - n, my(k=2); while(kronecker(n, k)!=1, k++); k); \\ Michel Marcus, May 27 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, May 27 2024
STATUS
approved