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

Number of ways of writing n as a sum of n+1 squares.
4

%I #19 Nov 16 2023 11:27:55

%S 1,4,12,32,90,312,1288,5504,22608,88660,339064,1297056,5043376,

%T 19975256,80027280,321692928,1291650786,5177295432,20748447108,

%U 83279292960,335056780464,1351064867328,5456890474248,22063059606912

%N Number of ways of writing n as a sum of n+1 squares.

%H Alois P. Heinz, <a href="/A066536/b066536.txt">Table of n, a(n) for n = 0..1000</a>

%F a(n) equals the coefficient of x^n in the (n+1)-th power of Jacobi theta_3(x) where theta_3(x) = 1 + 2*Sum_{n>=1} x^(n^2). - _Paul D. Hanna_, Oct 26 2009

%F a(n) is divisible by n+1: a(n)/(n+1) = A166952(n) for n>=0. - _Paul D. Hanna_, Oct 26 2009

%F a(n) ~ c * d^n / sqrt(n), where d = 4.13273137623493996302796465... (= 1/radius of convergence A166952), c = 0.70710538549959357505200... . - _Vaclav Kotesovec_, Sep 10 2014

%e There are a(2)=12 solutions (x,y,z) of 2=x^2+y^2+z^2: 3 permutations of (1,1,0), 3 permutations of (-1,-1,0) and 6 permutations of (1, -1,0).

%t Join[{1}, Table[SquaresR[n+1, n], {n, 24}]]

%t (* Calculation of constants {d,c}: *) {1/r, Sqrt[s/(2*Pi*r^2*Derivative[0, 0, 2][EllipticTheta][3, 0, r*s])]} /. FindRoot[{s == EllipticTheta[3, 0, r*s], r*Derivative[0, 0, 1][EllipticTheta][3, 0, r*s] == 1}, {r, 1/4}, {s, 5/2}, WorkingPrecision -> 70] (* _Vaclav Kotesovec_, Nov 16 2023 *)

%o (PARI) {a(n)=local(THETA3=1+2*sum(k=1,sqrtint(n),x^(k^2))+x*O(x^n));polcoeff(THETA3^(n+1), n)} /* _Paul D. Hanna_, Oct 26 2009*/

%Y Cf. A004018, A005875, A000118, A066535.

%Y Cf. A122141, A166952. - _Paul D. Hanna_, Oct 26 2009

%K nonn

%O 0,2

%A Peter Bertok (peter(AT)bertok.com), Jan 07 2002

%E Edited by _Dean Hickerson_, Jan 12, 2002

%E a(0) added by _Paul D. Hanna_, Oct 26 2009

%E Edited by _R. J. Mathar_, Oct 29 2009