A281939 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x - y and 3*z + w both squares, where x,y,z are nonnegative integers and w is an integer.
1, 2, 3, 2, 1, 2, 2, 2, 2, 3, 5, 2, 1, 4, 3, 3, 3, 3, 6, 1, 1, 4, 1, 2, 2, 3, 7, 5, 3, 3, 3, 4, 3, 4, 8, 3, 2, 4, 3, 4, 5, 7, 10, 2, 1, 7, 1, 2, 5, 2, 7, 4, 3, 4, 2, 3, 3, 3, 7, 4, 4, 3, 3, 6, 1, 5, 12, 4, 1, 4, 4, 3, 4, 5, 8, 4, 3, 4, 4, 3, 5
Offset: 0
Keywords
Examples
a(4) = 1 since 4 = 1^2 + 1^2 + 1^2 + 1^2 with 1 - 1 = 0^2 and 3*1 + 1 = 2^2. a(12) = 1 since 12 = 1^2 + 1^2 + 1^2 + (-3)^2 with 1 - 1 = 0^2 and 3*1 + (-3) = 0^2. a(19) = 1 since 19 = 3^2 + 3^2 + 0^2 + 1^2 with 3 - 3 = 0^2 and 3*0 + 1 = 1^2. a(20) = 1 since 20 = 3^2 + 3^2 + 1^2 + 1^2 with 3 - 3 = 0^2 and 3*1 + 1 = 2^2. a(22) = 1 since 22 = 3^2 + 2^2 + 3^2 + 0^2 with 3 - 2 = 1^2 and 3*3 + 0 = 3^2. a(44) = 1 since 44 = 3^2 + 3^2 + 5^2 + 1^2 with 3 - 3 = 0^2 and 3*5 + 1 = 4^2. a(46) = 1 since 46 = 5^2 + 4^2 + 1^2 + (-2)^2 with 5 - 4 = 1^2 and 3*1 + (-2) = 1^2. a(68) = 1 since 68 = 7^2 + 3^2 + 1^2 + (-3)^2 with 7 - 3 = 2^2 and 3*1 + (-3) = 0^2. a(212) = 1 since 212 = 5^2 + 5^2 + 9^2 + 9^2 with 5 - 5 = 0^2 and 3*9 + 9 = 6^2. a(1144) = 1 since 1144 = 20^2 + 16^2 + 22^2 + (-2)^2 with 20 - 16 = 2^2 and 3*22 + (-2) = 8^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.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; Do[r=0;Do[If[SQ[n-x^2-y^2-z^2]&&SQ[x-y]&&SQ[3z+(-1)^k*Sqrt[n-x^2-y^2-z^2]],r=r+1],{y,0,Sqrt[n/2]},{x,y,Sqrt[n-y^2]},{z,0,Sqrt[n-x^2-y^2]},{k,0,Min[Sqrt[n-x^2-y^2-z^2],1]}]; Print[n," ",r];Continue,{n,0,80}]
Comments