A301891 Number of ways to write 2*n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x + 3*y + 5*z + 15*w is a power of 4.
2, 1, 1, 2, 3, 1, 2, 1, 3, 1, 2, 1, 6, 3, 8, 2, 5, 4, 6, 3, 4, 3, 6, 1, 3, 3, 7, 2, 8, 9, 8, 1, 15, 5, 8, 3, 11, 1, 5, 1, 4, 4, 2, 2, 10, 7, 17, 1, 18, 11, 14, 6, 16, 6, 17, 3, 21, 10, 16, 8, 19, 8, 30, 2, 15, 9, 18, 5, 28, 5, 27, 4, 13, 11, 24, 6, 28, 17, 20, 3
Offset: 1
Keywords
Examples
a(1) = 2 since 2*1^2 = 1^2 + 1^2 + 0^2 + 0^2 with 1 + 3*1 + 5*0 + 15*0 = 4, and 2*1^2 = 1^2 + 0^2 + 0^2 + 1^2 with 1 + 3*0 + 5*0 + 15*1 = 4^2. a(2) = 1 since 2*2^2 = 0^2 + 2^2 + 2^2 + 0^2 with 0 + 3*2 + 5*2 + 15*0 = 4^2. a(3) = 1 since 2*3^2 = 1^2 + 1^2 + 0^2 + 4^2 with 1 + 3*1 + 5*0 + 15*4 = 4^3. a(6) = 1 since 2*6^2 = 0^2 + 8^2 + 2^2 + 2^2 with 0 + 3*8 + 5*2 + 15*2 = 4^3. a(10) = 1 since 2*10^2 = 10^2 + 8^2 + 6^2 + 0^2 with 10 + 3*8 + 5*6 + 15*0 = 4^3. a(38) = 1 since 2*38^2 = 34^2 + 34^2 + 24^2 + 0^2 with 34 + 3*34 + 5*24 + 15*0 = 4^4.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..225
- 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.
Crossrefs
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; Pow[n_]:=Pow[n]=IntegerQ[Log[4,n]] tab={};Do[r=0;Do[If[SQ[2n^2-x^2-y^2-z^2]&&Pow[x+3y+5z+15*Sqrt[2n^2-x^2-y^2-z^2]],r=r+1],{x,0,Sqrt[2]n},{y,0,Sqrt[2n^2-x^2]},{z,0,Sqrt[2n^2-x^2-y^2]}];tab=Append[tab,r],{n,1,80}];Print[tab]
Comments