login
A367034
a(n) is the smallest odd number k > 1 for which the Jacobi symbol (n / k) >= 0.
0
3, 3, 7, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 9, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 9, 3, 3, 5, 3, 3, 5, 3, 3, 9, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5, 3, 3, 9, 3, 3, 5, 3, 3, 9, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 9, 3, 3, 5, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 7, 3, 3, 5, 3, 3, 5
OFFSET
0,1
COMMENTS
This sequence is periodic with period P = 3*5*7 = 105.
All terms are in {3, 5, 7, 9}.
FORMULA
a(n + 105) = a(n).
MATHEMATICA
a[n_] := Module[{k = 3}, While[JacobiSymbol[n, k] < 0, k += 2]; k]; Array[a, 105, 0]
PROG
(PARI) a(n) = my(k=3); while(kronecker(n, k)<0, k+=2); k; \\ Michel Marcus, Nov 02 2023
CROSSREFS
Cf. A366973.
Sequence in context: A324543 A333339 A089488 * A366982 A366973 A076560
KEYWORD
nonn,easy
AUTHOR
Amiram Eldar and Thomas Ordowski, Nov 02 2023
STATUS
approved