login
Number of solutions to x^2 + 3y^2 = n in positive integers x and y.
13

%I #35 Feb 16 2024 06:34:25

%S 0,0,0,0,1,0,0,1,0,0,0,0,1,1,0,0,1,0,0,1,0,1,0,0,0,0,0,0,3,0,0,1,0,0,

%T 0,0,1,1,0,1,0,0,0,1,0,0,0,0,1,1,0,0,3,0,0,0,0,1,0,0,0,1,0,1,1,0,0,1,

%U 0,0,0,0,0,1,0,0,3,0,0,1,0,0,0,0,3,0,0,0,0,0,0,2,0,1,0,0,0,1,0,0,1,0,0

%N Number of solutions to x^2 + 3y^2 = n in positive integers x and y.

%H Robert Israel, <a href="/A092573/b092573.txt">Table of n, a(n) for n = 0..10000</a>

%H E. Akhtarkavan, M. F. M. Salleh and O. Sidek, <a href="https://www.idosi.org/wasj/wasj21(2)13/2.pdf">Multiple Descriptions Video Coding Using Coinciding Lattice Vector Quantizer for H.264/AVC and Motion JPEG2000</a>, World Applied Sciences Journal 21 (2): 157-169, 2013. - From _N. J. A. Sloane_, Feb 11 2013

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Eulers6nPlus1Theorem.html">Euler's 6n+1 Theorem</a>

%F a(n) = ( A033716(n) - A000122(n) - A000122(n/3) + A000007(n) )/4. - _Max Alekseyev_, Sep 29 2012

%F G.f.: (Theta_3(0,x)-1)*(Theta_3(0,x^3)-1)/4 where Theta_3 is a Jacobi theta function. - _Robert Israel_, Apr 03 2017

%p N:= 300: # to get a(0)..a(N)

%p V:= Vector(N):

%p for y from 1 to floor(sqrt(N/3-1)) do

%p js:= [seq(x^2+3*y^2, x=1..floor(sqrt(N-3*y^2)))];

%p V[js]:= map(`+`,V[js],1);

%p od:

%p 0,op(convert(V,list)); # _Robert Israel_, Apr 03 2017

%t r[z_] := Reduce[x > 0 && y > 0 && x^2 + 3 y^2 == z, {x, y}, Integers]; Table[rz = r[z]; If[rz === False, 0, If[rz[[0]] === Or, Length[rz], 1]], {z, 0, 102}] (* _Jean-François Alcover_, Oct 23 2012 *)

%t gf = (EllipticTheta[3, 0, x]-1)*(EllipticTheta[3, 0, x^3]-1)/4 + O[x]^105;

%t CoefficientList[gf, x] (* _Jean-François Alcover_, Jul 02 2018, after _Robert Israel_ *)

%Y Cf. A002476, A092572, A092575.

%K nonn

%O 0,29

%A _Eric W. Weisstein_, Feb 28 2004

%E Definition corrected by _David A. Corneth_, Apr 03 2017