A283196 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with 2*x + y and 2*x + z both squares, where x,y,z are integers with |y| <= |z|, and w is a positive integer.
1, 1, 1, 2, 2, 1, 3, 1, 1, 8, 1, 1, 6, 1, 3, 1, 3, 9, 2, 3, 3, 4, 4, 1, 7, 5, 2, 4, 3, 3, 6, 1, 5, 7, 1, 5, 4, 6, 4, 3, 2, 8, 3, 2, 11, 2, 6, 1, 6, 5, 1, 9, 4, 7, 11, 1, 3, 16, 1, 2, 5, 3, 14, 2, 7, 7, 4, 6, 3, 12, 6, 3, 8, 5, 2, 3, 5, 5, 9, 2
Offset: 1
Keywords
Examples
a(2) = 1 since 2 = 0^2 + 0^2 + 1^2 + 1^2 with 2*0 + 0 = 0^2 and 2*0 + 1 = 1^2. a(14) = 1 since 14 = 2^2 + 0^2 + (-3)^2 + 1^2 with 2*2 + 0 = 2^2 and 2*2 + (-3) = 1^2. a(59) = 1 since 59 = 3^2 + 3^2 + (-5)^2 + 4^2 with 2*3 + 3 = 3^2 and 2*3 + (-5) = 1^2. a(88) = 1 since 88 = (-2)^2 + 4^2 + 8^2 + 2^2 with 2*(-2) + 4 = 0^2 and 2*(-2) + 8 = 2^2. a(131) = 1 since 131 = 0^2 + 1^2 + 9^2 + 7^2 with 2*0 + 1 = 1^2 and 2*0 + 9 = 3^2. a(219) = 1 since 219 = 8^2 + (-7)^2 + 9^2 + 5^2 with 2*8 + (-7) = 3^2 and 2*8 + 9 = 5^2. a(249) = 1 since 249 = (-4)^2 + 8^2 + 12^2 + 5^2 with 2*(-4) + 8 = 0^2 and 2*(-4) + 12 = 2^2. a(312) = 1 since 312 = 6^2 + 4^2 + (-8)^2 + 14^2 with 2*6 + 4 = 4^2 and 2*6 + (-8) = 2^2. a(323) = 1 since 323 = 9^2 + 7^2 + 7^2 + 12^2 with 2*9 + 7 = 5^2. a(536) = 1 since 536 = (-6)^2 + 12^2 + 16^2 + 10^2 with 2*(-6) + 12 = 0^2 and 2*(-6) + 16 = 2^2. a(888) = 1 since 888 = 14^2 + 8^2 + (-12)^2 + 22^2 with 2*14 + 8 = 6^2 and 2*14 + (-12) = 4^2. a(1464) = 1 since 1464 = 2^2 + 0^2 + (-4)^2 + 38^2 with 2*2 + 0 = 2^2 and 2*2 + (-4) = 0^2. a(4152) = 1 since 4152 = 30^2 + 4^2 + (-56)^2 + 10^2 with 2*30 + 4 = 8^2 and 2*30 + (-56) = 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.
- Zhi-Wei Sun, Restricted sums of four squares, arXiv:1701.05868 [math.NT], 2017.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; Do[r=0;Do[If[SQ[2(-1)^i*x+(-1)^j*y],Do[If[SQ[n-x^2-y^2-z^2]&&SQ[2(-1)^i*x+(-1)^k*z],r=r+1],{z,y,Sqrt[n-1-x^2-y^2]},{k,0,Min[z,1]}]],{x,0,Sqrt[n-1]},{y,0,Sqrt[(n-1-x^2)/2]},{i,0,Min[x,1]},{j,0,Min[y,1]}];Print[n," ",r];Continue,{n,1,80}]
Comments