login
a(n) is the smallest number k>0 such that -n is not a quadratic residue modulo k.
1

%I #13 Jul 09 2022 11:09:48

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

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

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

%N a(n) is the smallest number k>0 such that -n is not a quadratic residue modulo k.

%C All values are prime powers, and every prime power except 2 appears in the sequence. This can be proved using the Chinese remainder theorem.

%o (PARI) a(n) = my(k=2); while (issquare(Mod(-n, k)), k++); k; \\ _Michel Marcus_, Jul 08 2022

%Y Cf. A139401.

%K nonn

%O 1,1

%A _Bruno Langlois_, Jul 08 2022