A306614 Number of ways to write n as w^2 + (x*(x+1)/2)^2 + (y*(3y+1)/2)^2 + (z*(5z+1)/2)^2, where w,x,y,z are integers with w > 0 and x >= 0.
1, 2, 1, 1, 4, 4, 1, 2, 5, 6, 4, 2, 5, 9, 4, 1, 6, 7, 4, 4, 4, 5, 4, 1, 4, 8, 4, 1, 6, 7, 3, 0, 3, 6, 7, 3, 3, 9, 5, 3, 7, 5, 3, 6, 7, 6, 5, 1, 7, 11, 4, 2, 7, 9, 5, 2, 3, 7, 9, 4, 3, 10, 6, 1, 8, 7, 3, 6, 6, 6, 6, 2, 4, 11, 4, 3, 5, 5, 4, 1, 4, 5, 9, 3, 6, 12, 5, 0, 7, 10, 6, 5, 3, 10, 9, 0, 2, 11, 5, 4
Offset: 1
Keywords
Examples
a(3) = 1 with 3 = 1^2 + (1*(1+1)/2)^2 + ((-1)*(3*(-1)+1)/2)^2 + (0*(5*0+1)/2)^2. a(4) = 1 with 4 = 2^2 + (0*(0+1)/2)^2 + (0*(3*0+1)/2)^2 + (0*(5*0+1)/2)^2. a(7) = 1 with 7 = 1^2 + (1*(1+1)/2)^2 + ((-1)*(3*(-1)+1)/2)^2 + ((-1)*(5*(-1)+1)/2)^2. a(28) = 1 with 28 = 3^2 + (2*(2+1)/2)^2 + ((-1)*(3*(-1)+1)/2)^2 + (1*(5*1+1)/2)^2.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
Programs
-
Mathematica
t[x_]:=t[x]=x(x+1)/2; p[x_]:=p[x]=x(3x+1)/2; q[x_]:=q[x]=x(5x+1)/2; SQ[n_]:=SQ[n]=n>0&&IntegerQ[Sqrt[n]]; tab={};Do[r=0;Do[If[SQ[n-t[x]^2-p[y]^2-q[z]^2],r=r+1],{x,0,(Sqrt[8*Sqrt[n-1]+1]-1)/2},{y,-Floor[(Sqrt[24*Sqrt[n-1-t[x]^2]+1]+1)/6],(Sqrt[24*Sqrt[n-1-t[x]^2]+1]-1)/6}, {z,-Floor[(Sqrt[40*Sqrt[n-1-t[x]^2-p[y]^2]+1]+1)/10],(Sqrt[40*Sqrt[n-1-t[x]^2-p[y]^2]+1]-1)/10}];tab=Append[tab,r],{n,1,100}];Print[tab]
Comments