OFFSET
0,2
COMMENTS
REFERENCES
J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 113.
L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 2, p. 263.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
N. J. A. Sloane and B. K. Teo, Theta series and magic numbers for close-packed spherical clusters, J. Chem. Phys. 83 (1985) 6520-6534.
L. V. Woodcock, Nature, Jan 09 1997, pp. 141-143.
LINKS
N. J. A. Sloane, Table of n, a(n) for n = 0..9999
G. Nebe and N. J. A. Sloane, Home page for this lattice
N. J. A. Sloane, A portion of the f.c.c. lattice packing.
Michael Somos, Introduction to Ramanujan theta functions
Eric Weisstein's World of Mathematics, Ramanujan Theta Functions
Eric Weisstein's World of Mathematics, Theta Series
FORMULA
Expansion of phi(q^2)^3 + 12 * q * phi(q^2) * psi(q^4)^2 in powers of q where phi(), psi() are Ramanujan theta functions. - Michael Somos, Oct 25 2006
Expansion of (phi(q)^3 + phi(-q)^3) / 2 in powers of q^2 where phi() is a Ramanujan theta function. - Michael Somos, Oct 25 2006
Expansion of b(q) * phi(q^18) + c(q^3) * phi(q^2) in powers of q^3 where b(), c() are cubic AGM theta functions and phi() is a Ramanujan theta function. - Michael Somos, Oct 25 2006
Expansion of (theta_3(q)^3 + theta_4(q)^3) / 2 in powers of q^2.
G.f. is a period 1 Fourier series which satisfies f(-1 / (8 t)) = 2^(7/2) (t/i)^(3/2) g(t) where q = exp(2 Pi i t) and g() is the g.f. for A004013.
a(n) = A005875(2*n).
G.f.: Sum_{i, j, k in Z} x^( i*i + j*j + k*k + i*j + i*k + j*k ). - Michael Somos, Jan 02 2012
From Michael Somos, Jan 05 2012: (Start)
Number of integer solutions to x^2 + y^2 + z^2 + x*y + x*z + y*z = n.
Number of integer solutions to x + y + z even and x^2 + y^2 + z^2 = 2 * n.
Number of integer solutions to x + y + z + w = 0 and x^2 + y^2 + z^2 + w^2 = 2 * n. (End)
EXAMPLE
G.f. = 1 + 12*x + 6*x^2 + 24*x^3 + 12*x^4 + 24*x^5 + 8*x^6 + 48*x^7 + 6*x^8 + ...
G.f. = 1 + 12*q^2 + 6*q^4 + 24*q^6 + 12*q^8 + 24*q^10 + 8*q^12 + 48*q^14 + 6*q^16 + ...
From Michael Somos, Jan 05 2012: (Start)
a(2) = 6 since (1, -1, -1) is a solution to x^2 + y^2 + z^2 + x*y + x*z + y*z = 2 and the other 5 solutions are permutations and negations of this one.
a(2) = 6 since (1, 1, -1, -1) is a solution to x + y + z + w = 0 and x^2 + y^2 + z^2 + w^2 = 4 and the other 5 solutions are permutations of this one. (End)
MAPLE
maxd := 201: temp0 := trunc(evalf(sqrt(maxd)))+2: a := 0: for i from -temp0 to temp0 do a := a+q^( (i+1/2)^2): od: th2 := series(a, q, maxd); a := 0: for i from -temp0 to temp0 do a := a+q^(i^2): od: th3 := series(a, q, maxd); th4 := series(subs(q=-q, th3), q, maxd); series((1/2)*(th3^3+th4^3), q, 200);
MATHEMATICA
a[n_] := SquaresR[3, 2n]; Table[a[n], {n, 0, 69}] (* Jean-François Alcover, Jul 12 2012 *)
a[ n_] := SeriesCoefficient[ (EllipticTheta[ 3, 0, q]^3 + EllipticTheta[ 4, 0, q]^3) / 2, {q, 0, 2 n}]; (* Michael Somos, May 24 2013 *)
a[ n_] := SeriesCoefficient[ EllipticTheta[ 3, 0, q^2]^3 + 12 q QPochhammer[ q^4]^3 QPochhammer[ q^8]^2 / QPochhammer[ q^2]^2, {q, 0, n}]; (* Michael Somos, Nov 13 2014 *)
SquaresR[3, 2*Range[0, 70]] (* Harvey P. Dale, Jun 01 2015 *)
PROG
(PARI) {a(n) = if( n<0, 0, n*=2; polcoeff( sum( k=1, sqrtint(n), 2 * x^k^2, 1 + x * O(x^n))^3, n))}; /* Michael Somos, Oct 25 2006 */
(PARI) {a(n) = my(A); if( n<0, 0, A = x * O(x^n); polcoeff( (eta(x^4 + A)^5 / eta(x^2 + A)^2 / eta(x^8 + A)^2)^3 + 12 * x * eta(x^4 + A)^3 * eta(x^8 + A)^2 / eta(x^2 + A)^2, n))}; /* Michael Somos, May 17 2008 */
(PARI) {a(n) = if( n<1, n==0, 2 * qfrep( [2, 1, 1; 1, 2, 1; 1, 1, 2], n, 1)[n])}; /* Michael Somos, Jan 02 2012 */
(Magma) L := Lattice("A", 3); A<q> := ThetaSeries(L, 140); A; /* Michael Somos, Nov 13 2014 */
(Magma) A := Basis( ModularForms( Gamma1(8), 3/2), 70); A[1] + 12*A[2] + 6*A[3] + 24*A[4]; /* Michael Somos, Sep 08 2018 */
(Python)
from math import prod, isqrt
from sympy import factorint
def A004018(n): return prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in factorint(n).items())<<2 if n else 1
def A004015(n): return A004018(m:=n<<1)+(sum(A004018(m-k**2) for k in range(1, isqrt(m)+1))<<1) # Chai Wah Wu, Feb 24 2025
CROSSREFS
KEYWORD
nonn,easy,nice
AUTHOR
STATUS
approved