A111986 Number of numbers having n quadratic residues.
1, 3, 2, 5, 0, 5, 2, 6, 2, 1, 2, 12, 0, 4, 1, 6, 0, 6, 1, 3, 4, 7, 1, 17, 0, 0, 3, 7, 0, 6, 2, 6, 3, 1, 0, 15, 1, 3, 0, 6, 0, 11, 0, 14, 3, 1, 0, 24, 2, 0, 1, 1, 1, 10, 1, 8, 3, 0, 0, 13, 0, 5, 5, 7, 0, 10, 0, 3, 2, 3, 0, 26, 0, 3, 1, 6, 4, 0, 2, 9, 3, 1, 0, 25, 0, 0, 2, 18, 0, 13, 1, 3, 4, 0, 0, 26
Offset: 1
Keywords
Examples
a(4)=5 because the numbers 6, 7, 9, 12 and 16 each have 4 quadratic residues.
Crossrefs
Programs
-
Mathematica
t=Table[Length[Union[Mod[Range[0, n/2]^2, n]]], {n, 10000}]; Table[Length[Position[t, n]], {n, 100}]