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.

A113406 Half the number of integer solutions to x^2 + 4 * y^2 = n.

This page as a plain text file.
%I A113406 #17 Oct 15 2022 08:09:33
%S A113406 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,
%T A113406 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,
%U A113406 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
%N A113406 Half the number of integer solutions to x^2 + 4 * y^2 = n.
%D A113406 B. C. Berndt, Ramanujan's Notebooks Part V, Springer-Verlag, see p. 373 Entry 32.
%D A113406 J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 120.
%H A113406 G. C. Greubel, <a href="/A113406/b113406.txt">Table of n, a(n) for n = 1..1000</a>
%F A113406 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)
%F A113406 G.f.: (theta_3(q) * theta_3(q^4) - 1) / 2.
%F A113406 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.
%F A113406 Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/4 = 0.785398... (A003881). - _Amiram Eldar_, Oct 15 2022
%e A113406 x + 2*x^4 + 2*x^5 + 2*x^8 + x^9 + 2*x^13 + 2*x^16 + 2*x^17 + 4*x^20 + ...
%t A113406 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 *)
%o A113406 (PARI) {a(n) = if( n<1, 0, qfrep( [1, 0; 0, 4], n)[n])}
%o A113406 (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)))))}
%o A113406 (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)))))}
%Y A113406 Cf. A003881, A004018, A004531, A008441.
%K A113406 nonn,mult
%O A113406 1,4
%A A113406 _Michael Somos_, Oct 28 2005