A300362 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x + 2*y and (z + 2*w)/3 are squares and w is even.
1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 4, 2, 4, 1, 2, 2, 2, 3, 2, 1, 5, 1, 5, 2, 3, 3, 3, 1, 1, 2, 3, 1, 4, 3, 5, 1, 6, 6, 6, 1, 4, 6, 8, 2, 4, 4, 3, 1, 5, 3, 9, 1, 4, 4, 5, 3, 10, 4, 7, 3, 9, 2, 14, 2, 6, 2, 6, 1
Offset: 0
Keywords
Examples
a(9) = 1 since 9^2 = 9^2 + 0^2 + 0^2 + 0^2 with 9 + 2*0 = 3^2 and 0 + 2*0 = 3*0^2. a(13) = 1 since 13^2 = 4^2 + 0^2 + 3^2 + 12^2 with 4 + 2*0 = 2^2 and 3 + 2*12 = 3*3^2. a(14) = 1 since 14^2 = 4^2 + 6^2 + 12^2 + 0^2 with 4 + 2*6 = 4^2 and 12 + 2*0 = 3*2^2. a(15) = 1 since 15^2 = 9^2 + 0^2 + 12^2 + 0^2 with 9 + 2*0 = 3^2 and 12 + 2*0 = 3*2^2. a(41) = 1 since 41 = 38^2 + 13^2 + 8^2 + 2^2 with 38 + 2*13 = 8^2 and 8 + 2*2 = 3*2^2.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 0..1000
- 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[x+2y]&&SQ[(n^2-x^2-y^2-z^2)/4]&&SQ[(z+2*Sqrt[n^2-x^2-y^2-z^2])/3],r=r+1],{x,0,n},{y,0,Sqrt[n^2-x^2]},{z,0,Sqrt[n^2-x^2-y^2]}];tab=Append[tab,r],{n,0,80}];Print[tab]
Comments