A299924 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 + 3*z is a power of 4 (including 4^0 = 1).
1, 1, 1, 1, 3, 4, 1, 1, 2, 2, 1, 2, 1, 1, 3, 1, 1, 11, 4, 6, 7, 7, 8, 4, 4, 6, 14, 4, 6, 17, 10, 1, 10, 6, 10, 7, 4, 4, 16, 2, 3, 10, 2, 1, 9, 6, 3, 2, 1, 5, 2, 3, 7, 9, 3, 1, 6, 2, 3, 7, 1, 4, 4, 1, 3, 4, 3, 1, 13, 20
Offset: 1
Keywords
Examples
a(1) = 1 since 1^2 = 1^2 + 0^2 + 0^2 + 0^2 with 1 + 2*0 + 3*0 = 4^0. a(2) = 1 since 2^2 = 0^2 + 2^2 + 0^2 + 0^2 with 0 + 2*2 + 3*0 = 4. a(3) = 1 since 3^2 = 2^2 + 1^2 + 0^2 + 2^2 with 2 + 2*1 + 3*0 = 4. a(7) = 1 since 7^2 = 2^2 + 4^2 + 2^2 + 5^2 with 2 + 2*4 + 3*2 = 4^2. a(11) = 1 since 11^2 = 2^2 + 1^2 + 4^2 + 10^2 with 2 + 2*1 + 4*3 = 4^2. a(13) = 1 since 13^2 = 8^2 + 1^2 + 2^2 + 10^2 with 8 + 2*1 + 3*2 = 4^2. a(14) = 1 since 14^2 = 4^2 + 6^2 + 0^2 + 12^2 with 4 + 2*6 + 3*0 = 4^2. a(17) = 1 since 17^2 = 0^2 + 8^2 + 0^2 + 15^2 with 0 + 2*8 + 4*0 = 4^2. a(49) = 1 since 49^2 = 22^2 + 3^2 + 12^2 + 42^2 with 22 + 2*3 + 3*12 = 4^3. a(61) = 1 since 61^2 = 6^2 + 20^2 + 6^2 + 57^2 with 6 + 2*20 + 3*6 = 4^3.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..500
- 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]]; Pow[n_]:=Pow[n]=IntegerQ[Log[4,n]]; Do[r=0;Do[If[SQ[n^2-x^2-y^2-z^2]&&Pow[x+2y+3z],r=r+1],{x,0,n},{y,0,Sqrt[n^2-x^2]},{z,0,Sqrt[n^2-x^2-y^2]}];Print[n," ",r],{n,1,70}]
Comments