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

KEYWORD

nonn,easy

AUTHOR

Amiram Eldar and Thomas Ordowski, Nov 02 2023

STATUS

approved