A300712 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that 3*x or y is a square and x - y is twice a square.
1, 1, 2, 1, 3, 2, 2, 1, 2, 2, 3, 2, 3, 2, 2, 2, 1, 2, 4, 3, 5, 1, 3, 2, 1, 2, 3, 4, 3, 3, 2, 2, 2, 2, 4, 3, 6, 2, 3, 2, 3, 3, 3, 3, 3, 3, 1, 3, 1, 3, 5, 2, 6, 3, 5, 3, 2, 4, 3, 2, 4, 3, 3, 3, 3, 5, 3, 3, 8, 5, 3, 2, 5, 3, 4, 3, 3, 5, 3, 1, 2
Offset: 0
Keywords
Examples
a(21) = 1 since 21 = 2^2 + 0^2 + 1^2 + 4^2 with 0 = 0^2 and 2 - 0 = 2*1^2. a(79) = 1 since 79 = 3^2 + 3^2 + 5^2 + 6^2 with 3*3 = 3^2 and 3 - 3 = 2*0^2. a(142) = 1 since 142 = 6^2 + 4^2 + 3^2 + 9^2 with 4 = 2^2 and 6 - 4 = 2*1^2. a(190) = 1 since 190 = 3^2 + 1^2 + 6^2 + 12^2 with 1 = 1^2 and 3 - 1 = 2*1^2. a(193) = 1 since 193 = 0^2 + 0^2 + 7^2 + 12^2 with 0 = 0^2 and 0 - 0 = 2*0^2. a(280) = 1 since 280 = 12^2 + 10^2 + 0^2 + 6^2 with 3*12 = 6^2 and 12 - 10 = 2*1^2. a(1336) = 1 since 1336 = 2^2 + 0^2 + 6^2 + 36^2 with 0 = 0^2 and 2 - 0 = 2*1^2.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 0..10000
- Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
- Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017-2018.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; tab={};Do[r=0;Do[If[(SQ[3(2m^2+y)]||SQ[y])&&SQ[n-(2m^2+y)^2-y^2-z^2],r=r+1],{m,0,(n/4)^(1/4)},{y,0,Sqrt[(n-4m^4)/2]},{z,0,Sqrt[Max[0,(n-(2m^2+y)^2-y^2)/2]]}];tab=Append[tab,r],{n,0,80}];Print[tab]
Comments