login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) is the smallest odd number k > 1 for which the Jacobi symbol (n / k) >= 0.
0

%I #19 Nov 07 2023 07:27:43

%S 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,

%T 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,

%U 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

%N a(n) is the smallest odd number k > 1 for which the Jacobi symbol (n / k) >= 0.

%C This sequence is periodic with period P = 3*5*7 = 105.

%C All terms are in {3, 5, 7, 9}.

%F a(n + 105) = a(n).

%t a[n_] := Module[{k = 3}, While[JacobiSymbol[n, k] < 0, k += 2]; k]; Array[a, 105, 0]

%o (PARI) a(n) = my(k=3); while(kronecker(n,k)<0, k+=2); k; \\ _Michel Marcus_, Nov 02 2023

%Y Cf. A366973.

%K nonn,easy

%O 0,1

%A _Amiram Eldar_ and _Thomas Ordowski_, Nov 02 2023