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”).

A354597
a(n) is the smallest number k>0 such that -n is not a quadratic residue modulo k.
1
3, 4, 5, 3, 4, 4, 3, 5, 4, 3, 7, 5, 3, 4, 7, 3, 4, 4, 3, 11, 4, 3, 5, 9, 3, 4, 5, 3, 4, 4, 3, 5, 4, 3, 8, 7, 3, 4, 7, 3, 4, 4, 3, 7, 4, 3, 5, 5, 3, 4, 7, 3, 4, 4, 3, 11, 4, 3, 8, 7, 3, 4, 5, 3, 4, 4, 3, 5, 4, 3, 7, 5, 3, 4, 8, 3, 4, 4, 3, 11, 4, 3, 5, 9, 3, 4, 5, 3, 4, 4, 3, 5, 4, 3, 7, 9, 3, 4, 7, 3
OFFSET
1,1
COMMENTS
All values are prime powers, and every prime power except 2 appears in the sequence. This can be proved using the Chinese remainder theorem.
PROG
(PARI) a(n) = my(k=2); while (issquare(Mod(-n, k)), k++); k; \\ Michel Marcus, Jul 08 2022
CROSSREFS
Cf. A139401.
Sequence in context: A163874 A165565 A033706 * A121890 A330740 A178231
KEYWORD
nonn
AUTHOR
Bruno Langlois, Jul 08 2022
STATUS
approved