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

A113406
Half the number of integer solutions to x^2 + 4 * y^2 = n.
7
1, 0, 0, 2, 2, 0, 0, 2, 1, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 2, 0, 0, 4, 2, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 4, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 4, 0, 0, 4, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 6, 2, 0, 0, 4, 0
OFFSET
1,4
REFERENCES
B. C. Berndt, Ramanujan's Notebooks Part V, Springer-Verlag, see p. 373 Entry 32.
J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 120.
LINKS
FORMULA
a(n) is multiplicative with a(2) = 0, a(2^e) = 2 if e>1, a(p^e) = e+1 if p == 1 (mod 4), a(p^e) = (1 + (-1)^e)/2 if p == 3 (mod 4)
G.f.: (theta_3(q) * theta_3(q^4) - 1) / 2.
a(4*n + 2) = a(4*n + 3) = 0. A004531(n) = 2 * a(n) if n>0. a(4*n + 1) = A008441(n). A004018(n) = 2 * a(4*n) if n>0.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/4 = 0.785398... (A003881). - Amiram Eldar, Oct 15 2022
EXAMPLE
x + 2*x^4 + 2*x^5 + 2*x^8 + x^9 + 2*x^13 + 2*x^16 + 2*x^17 + 4*x^20 + ...
MATHEMATICA
s = (EllipticTheta[3, 0, q]*EllipticTheta[3, 0, q^4] - 1)/(2 q) + O[q]^105; CoefficientList[s, q] (* Jean-François Alcover, Dec 02 2015 *)
PROG
(PARI) {a(n) = if( n<1, 0, qfrep( [1, 0; 0, 4], n)[n])}
(PARI) {a(n) = if( n<1, 0, if( n%4==1, sumdiv( n, d, (-1)^(d\2)), if( n%4==0, 2 * sumdiv( n, d, kronecker( -4, d)))))}
(PARI) {a(n) = local(A, p, e); if( n<1, 0, A = factor(n); prod( k=1, matsize(A)[1], if( p = A[k, 1], e = A[k, 2]; if( p==2, 2 * (e>1), if( p%4==3, (1 + (-1)^e) / 2, e+1)))))}
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Michael Somos, Oct 28 2005
STATUS
approved