%I #80 Jun 21 2024 12:39:18
%S 1,12,60,160,252,312,544,960,1020,876,1560,2400,2080,2040,3264,4160,
%T 4092,3480,4380,7200,6552,4608,8160,10560,8224,7812,10200,13120,12480,
%U 10104,14144,19200,16380,11520,17400,24960,18396,16440,24480,27200
%N Number of ways of writing n as a sum of 6 squares.
%C The relevant identity for the o.g.f. is theta_3(x)^6 = 1 + 16*Sum_{j>=1} j^2*x^j/(1 + x^(2*j)) - 4*Sum_{j >=0} (-1)^j*(2*j+1)^2 *x^(2*j+1)/(1 - x^(2*j+1)), See the Hardy-Wright reference, p. 315, first equation. - _Wolfdieter Lang_, Dec 08 2016
%D E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 121.
%D G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 314.
%H T. D. Noe, <a href="/A000141/b000141.txt">Table of n, a(n) for n = 0..10000</a>
%H L. Carlitz, <a href="http://dx.doi.org/10.1090/S0002-9939-1957-0084520-2">Note on sums of four and six squares</a>, Proc. Amer. Math. Soc. 8 (1957), 120-124
%H S. H. Chan, <a href="http://www.jstor.org/stable/4145192">An elementary proof of Jacobi's six squares theorem</a>, Amer. Math. Monthly, 111 (2004), 806-811.
%H H. H. Chan and C. Krattenthaler, <a href="https://arxiv.org/abs/math/0407061">Recent progress in the study of representations of integers as sums of squares</a>, arXiv:math/0407061 [math.NT], 2004.
%H Shi-Chao Chen, <a href="http://dx.doi.org/10.1016/j.jnt.2010.01.011">Congruences for rs(n)</a>, Journal of Number Theory, Volume 130, Issue 9, September 2010, Pages 2028-2032.
%H Philippe A. J. G. Chevalier, <a href="https://www.researchgate.net/publication/236594822_On_the_discrete_geometry_of_physical_quantities">On the discrete geometry of physical quantities</a>, 2013, Preprint submitted to Journal of Geometry and Physics.
%H S. C. Milne, <a href="http://dx.doi.org/10.1023/A:1014865816981">Infinite families of exact sums of squares formulas, Jacobi elliptic functions, continued fractions and Schur functions</a>, Ramanujan J., 6 (2002), 7-149.
%H <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>
%F Expansion of theta_3(z)^6.
%F a(n) = 4( Sum_{ d|n, d ==3 mod 4} d^2 - Sum_{ d|n, d ==1 mod 4} d^2 ) + 16( Sum_{ d|n, n/d ==1 mod 4} d^2 - Sum_{ d|n, n/d ==3 mod 4} d^2 ) [Jacobi]. [corrected by _Sean A. Irvine_, Oct 01 2009]
%F a(n) = 16*A050470(n) - 4*A002173(n). - _Michel Marcus_, Dec 15 2012
%F a(n) = (12/n)*Sum_{k=1..n} A186690(k)*a(n-k), a(0) = 1. - _Seiichi Manyama_, May 27 2017
%p (sum(x^(m^2),m=-10..10))^6;
%p # Alternative:
%p A000141list := proc(len) series(JacobiTheta3(0, x)^6, x, len+1);
%p seq(coeff(%, x, j), j=0..len-1) end: A000141list(40); # _Peter Luschny_, Oct 02 2018
%t Table[SquaresR[6, n], {n, 0, 40}] (* _Ray Chandler_, Dec 06 2006 *)
%t SquaresR[6,Range[0,50]] (* _Harvey P. Dale_, Aug 26 2011 *)
%t EllipticTheta[3, 0, z]^6 + O[z]^40 // CoefficientList[#, z]& (* _Jean-François Alcover_, Dec 05 2019 *)
%o (Haskell)
%o a000141 0 = 1
%o a000141 n = 16 * a050470 n - 4 * a002173 n
%o -- _Reinhard Zumkeller_, Jun 17 2013
%o (Sage)
%o Q = DiagonalQuadraticForm(ZZ, [1]*6)
%o Q.representation_number_list(40) # _Peter Luschny_, Jun 20 2014
%o (Python)
%o from math import prod
%o from sympy import factorint
%o def A000141(n):
%o if n == 0: return 1
%o f = [(p,e,(0,1,0,-1)[p&3]) for p,e in factorint(n).items()]
%o return (prod((p**(e+1<<1)-c)//(p**2-c) for p, e, c in f)<<2)-prod(((k:=p**2*c)**(e+1)-1)//(k-1) for p, e, c in f)<<2 # _Chai Wah Wu_, Jun 21 2024
%Y Row d=6 of A122141 and of A319574, 6th column of A286815.
%Y Cf. A050470, A002173.
%K nonn,easy,nice
%O 0,2
%A _N. J. A. Sloane_
%E Extended by _Ray Chandler_, Nov 28 2006