cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A229295 Number of solutions to x^2 + y^2 + z^2 == n (mod 2n) for x,y,z in [0, 2*n).

Original entry on oeis.org

4, 24, 36, 32, 100, 216, 196, 192, 396, 600, 484, 288, 676, 1176, 900, 256, 1156, 2376, 1444, 800, 1764, 2904, 2116, 1728, 2900, 4056, 3564, 1568, 3364, 5400, 3844, 1536, 4356, 6936, 4900, 3168, 5476, 8664, 6084, 4800, 6724, 10584, 7396, 3872, 9900, 12696
Offset: 1

Views

Author

Keywords

Comments

All values are divisible by a(1)=4 and the sequence a(n)/4 is multiplicative. - Andrew Howroyd, Aug 07 2018

Crossrefs

Programs

  • Mathematica
    A[n_] := Sum[If[Mod[a^2 + b^2 + c^2, 2*n] == n, 1, 0], {a, 0, 2*n - 1}, {b, 0, 2*n - 1}, {c, 0, 2*n - 1}]; Array[A,100]
  • PARI
    a(n)={my(m=2*n); my(p=Mod(sum(i=0, m-1, x^(i^2%m)), x^m-1)^3); polcoeff( lift(p), n)} \\ Andrew Howroyd, Aug 06 2018
    
  • PARI
    a(n)={my(f=factor(n)); 4*prod(i=1, #f~, my([p, e]=f[i, ]); if(p==2, if(e%2, 3, 1)*2^(e+e\2), p^(e+(e-1)\2)*(p^(e\2)*(p+1) - 1)))} \\ Andrew Howroyd, Aug 07 2018

Formula

a(n) = 4*A087687(n) for odd n, a(4^k) = 4*2^(3*k), a(2*4^k) = 24*2^(3*k). - Andrew Howroyd, Aug 07 2018