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

A111986
Number of numbers having n quadratic residues.
3
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,2
EXAMPLE
a(4)=5 because the numbers 6, 7, 9, 12 and 16 each have 4 quadratic residues.
MATHEMATICA
t=Table[Length[Union[Mod[Range[0, n/2]^2, n]]], {n, 10000}]; Table[Length[Position[t, n]], {n, 100}]
CROSSREFS
Cf. A037041 (n such that a(n)>0), A037046 (n such that a(n)=0), A111987 (least number having n quadratic residues), A111988 (greatest number having n quadratic residues).
Sequence in context: A378644 A083254 A068453 * A368744 A291455 A248849
KEYWORD
nonn
AUTHOR
T. D. Noe, Aug 25 2005
STATUS
approved