A283170 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x + 2*y and z + 2*w both squares, where x and w are nonnegative integers, and y and z are integers.
1, 2, 2, 1, 2, 6, 5, 2, 1, 4, 5, 1, 1, 2, 3, 2, 2, 6, 9, 3, 5, 8, 7, 6, 2, 4, 2, 2, 1, 5, 7, 6, 2, 8, 10, 3, 5, 5, 4, 4, 1, 1, 8, 1, 2, 6, 7, 4, 1, 7, 12, 3, 5, 5, 7, 10, 2, 7, 9, 1, 2, 8, 8, 12, 2, 11, 13, 2, 7, 11, 9, 8, 3, 4, 10, 3, 2, 6, 6, 10, 6
Offset: 0
Keywords
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.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; Do[r=0;Do[If[SQ[x+2(-1)^j*y],Do[If[SQ[n-x^2-y^2-z^2]&&SQ[(-1)^k*z+2*Sqrt[n-x^2-y^2-z^2]],r=r+1],{z,0,Sqrt[n-x^2-y^2]},{k,0,Min[z,1]}]],{x,0,Sqrt[n]},{y,0,Sqrt[n-x^2]},{j,0,Min[y,1]}];Print[n," ",r];Continue,{n,0,80}]
Formula
a(3) = 1 since 3 = 1^2 + 0^2 + (-1)^2 + 1^2 with 1 + 2*0 = 1^2 and (-1)+2*1 = 1^2.
a(4) = 2 since 4 = 0^2 + 0^2 + 0^2 + 2^2 with 0 + 2*0 = 0^2 and 0 + 2*2 = 2^2, and also 4 = 0^2 + 2^2 + 0^2 + 0^2 with 0 + 2*2 = 2^2 and 0 + 2*0 = 0^2.
a(8) = 1 since 8 = 0^2 + 2^2 + 0^2 + 2^2 with 0 + 2*2 = 2^2 and 0 + 2*2 = 2^2.
a(11) = 1 since 11 = 3^2 + (-1)^2 + 1^2 + 0^2 with 3 + 2*(-1) = 1^2 and 1 + 2*0 = 1^2.
a(12) = 1 since 12 = 3^2 + (-1)^2 + (-1)^2 + 1^2 with 3 + 2*(-1) = 1^2 and (-1) + 2*1 = 1^2.
a(28) = 1 since 28 = 3^2 + (-1)^2 + 3^2 + 3^2 with 3 + 2*(-1) = 1^2 and 3 + 2*3 = 3^2.
a(40) = 1 since 40 = 4^2 + (-2)^2 + (-4)^2 + 2^2 with 4 + 2*(-2) = 0^2 and (-4) + 2*2 = 0^2.
a(41) = 1 since 41 = 6^2 + (-1)^2 + 0^2 + 2^2 with 6 + 2*(-1) = 2^2 and 0 + 2*2 = 2^2.
a(332) = 1 since 332 = 11^2 + 7^2 + (-9)^2 + 9^2 with 11 + 2*7 = 5^2 and (-9) + 2*9 = 3^2.
a(443) = 1 since 443 = 19^2 + (-9)^2 + 1^2 + 0^2 with 19 + 2*(-9) = 1^2 and 1 + 2*0 = 1^2.
a(488) = 1 since 488 = 12^2 + 2^2 + (-12)^2 + 14^2 with 12 + 2*2 = 4^2 and (-12) + 2*14 = 4^2.
a(808) = 1 since 808 = 8^2 + 14^2 + (-8)^2 + 22^2 with 8 + 2*14 = 6^2 and (-8) + 2*22 = 6^2.
a(892) = 1 since 892 = 27^2 + (-1)^2 + (-9)^2 + 9^2 with 27 + 2*(-1) = 5^2 and (-9) + 2*9 = 3^2.
Comments