A281941 Number of ways to write n as w^2 + x^2 + y^2 + z^2 with w and w + x + y + z both squares, where w,x,y,z are integers with |x| <= |y| <= |z|.
1, 2, 3, 5, 4, 1, 5, 2, 3, 4, 5, 1, 3, 1, 4, 2, 2, 1, 10, 5, 2, 2, 6, 1, 7, 7, 5, 7, 4, 3, 7, 1, 3, 12, 9, 4, 2, 2, 5, 3, 5, 5, 9, 10, 1, 5, 5, 1, 5, 3, 6, 8, 2, 4, 9, 4, 4, 8, 5, 3, 3, 4, 5, 3, 4, 5, 10, 4, 1, 5, 7, 1, 7, 10, 6, 8, 3, 2, 10, 2, 1
Offset: 0
Keywords
Examples
a(5) = 1 since 5 = 0^2 + 0^2 + (-1)^2 + 2^2 with 0 = 0^2 and 0 + 0 + (-1) + 2 = 1^2. a(23) = 1 since 23 = 1^2 + 2^2 + 3^2 + 3^2 with 1 = 1^2 and 1 + 2 + 3 + 3 = 3^2. a(47) = 1 since 47 = 1^2 + (-1)^2 + 3^2 + 6^2 with 1 = 1^2 and 1 + (-1) + 3 + 6 = 3^2. a(157) = 1 since 157 = 4^2 + (-2)^2 + (-4)^2 + 11^2 with 4 = 2^2 and 4 + (-2) + (-4) + 11 = 3^2. a(284) = 1 since 284 = 9^2 + 3^2 + 5^2 + (-13)^2 with 9 = 3^2 and 9 + 3 + 5 + (-13) = 2^2. a(628) = 1 since 628 = 9^2 + (-5)^2 + (-9)^2 + 21^2 with 9 = 3^2 and 9 + (-5) + (-9) + 21 = 4^2.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 0..10000
- Yu-Chen Sun and Zhi-Wei Sun, Some refinements of Lagrange's four-square theorem, arXiv:1605.03074 [math.NT], 2016-2017.
- Zhi-Wei Sun, Refining Lagrange's four-square theorem, J. Number Theory 175(2017), 167-190.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; Do[r=0;Do[If[SQ[n-x^4-y^2-z^2]&&SQ[x^2+(-1)^i*y+(-1)^j*z+(-1)^k*Sqrt[n-x^4-y^2-z^2]],r=r+1],{x,0,n^(1/4)},{y,0,Sqrt[(n-x^4)/3]},{i,0,Min[y,1]},{z,y,Sqrt[(n-x^4-y^2)/2]},{j,0,Min[z,1]},{k,0,Min[Sqrt[n-x^4-y^2-z^2],1]}];Print[n," ",r];Continue,{n,0,80}]
Comments