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

A229296
Number of solutions to x^2 + y^2 == n (mod 2*n) for x,y in [0, 2*n).
4
2, 4, 2, 8, 18, 4, 2, 16, 18, 36, 2, 8, 50, 4, 18, 32, 66, 36, 2, 72, 2, 4, 2, 16, 130, 100, 18, 8, 114, 36, 2, 64, 2, 132, 18, 72, 146, 4, 50, 144, 162, 4, 2, 8, 162, 4, 2, 32, 98, 260, 66, 200, 210, 36, 18, 16, 2, 228, 2, 72, 242, 4, 18, 128, 450, 4, 2
OFFSET
1,1
LINKS
FORMULA
a(n) = 2*A086933(n). - Andrew Howroyd, Aug 07 2018
MATHEMATICA
A[n_] := Sum[If[Mod[a^2+b^2, 2n] == n, 1, 0], {a, 0, 2n - 1}, {b, 0, 2n - 1}]; Array[A, 100]
PROG
(PARI) a(n)={my(m=2*n); my(p=Mod(sum(i=0, m-1, x^(i^2%m)), x^m-1)^2); polcoeff( lift(p), n)} \\ Andrew Howroyd, Aug 07 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved