A284343 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and y <= z such that 2*x + y - z is either zero or a power of 8 (including 8^0 = 1).
1, 1, 2, 2, 1, 1, 4, 1, 1, 3, 1, 3, 2, 1, 3, 3, 2, 3, 5, 2, 3, 4, 6, 1, 3, 5, 1, 6, 1, 3, 7, 2, 2, 5, 6, 5, 6, 3, 6, 4, 1, 3, 4, 5, 4, 5, 7, 2, 3, 8, 6, 7, 3, 4, 8, 3, 2, 6, 3, 5, 7, 3, 8, 7, 2, 4, 10, 4, 4, 7, 9, 7, 2, 4, 2, 7, 3, 5, 11, 2, 4
Offset: 0
Keywords
Examples
a(4) = 1 since 4 = 0^2 + 0^2 + 0^2 + 2^2 with 0 = 0 and 2*0 + 0 - 0 = 0. a(5) = 1 since 5 = 1^2 + 0^2 + 2^2 + 0^2 with 0 < 2 and 2*1 + 0 - 2 = 0. a(7) = 1 since 7 = 1^2 + 1^2 + 2^2 + 1^2 with 1 < 2 and 2*1 + 1 - 2 = 8^0. a(40) = 1 since 40 = 4^2 + 2^2 + 2^2 + 4^2 with 2 = 2 and 2*4 + 2 - 2 = 8. a(138) = 1 since 138 = 3^2 + 5^2 + 10^2 + 2^2 with 5 < 10 and 2*3 + 5 - 10 = 8^0. a(1832) = 1 since 1832 = 4^2 + 30^2 + 30^2 + 4^2 with 30 = 30 and 2*4 + 30 - 30 = 8. a(2976) = 1 since 2976 = 20^2 + 16^2 + 48^2 + 4^2 with 16 < 48 and 2*20 + 16 - 48 = 8.
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]]; Pow[n_]:=Pow[n]=n==0||(n>0&&IntegerQ[Log[8,n]]); Do[r=0;Do[If[SQ[n-x^2-y^2-z^2]&&Pow[2x+y-z],r=r+1],{x,0,Sqrt[n]},{y,0,Sqrt[(n-x^2)/2]},{z,y,Sqrt[n-x^2-y^2]}];Print[n," ",r],{n,0,80}]
Comments