A299537 Number of ways to write n^2 as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers and z <= w such that x or y is a power of 4 (including 4^0 = 1) and x + 3*y is also a power of 4.
1, 1, 1, 1, 1, 4, 1, 1, 4, 3, 1, 1, 2, 6, 1, 1, 2, 3, 1, 1, 8, 6, 2, 4, 3, 8, 3, 1, 6, 8, 4, 1, 6, 10, 3, 4, 2, 5, 6, 3, 4, 8, 1, 1, 7, 5, 1, 1, 5, 6, 4, 2, 4, 13, 5, 6, 7, 5, 5, 1, 3, 7, 2, 1, 3, 12, 6, 2, 11, 5, 5, 3, 7, 11, 2, 1, 6, 13, 5, 1
Offset: 1
Keywords
Examples
a(2) = 1 since 2^2 = 1^2 + 1^2 + 1^2 + 1^2 with 1 = 4^0 and 1 + 3*1 = 4^1. a(5) = 1 since 5^2 = 4^2 + 0^2 + 0^2 + 3^2 with 4 = 4^1 and 4 + 3*0 = 4^1. a(19) = 1 since 19^2 = 1^2 + 0^2 + 6^2 + 18^2 with 1 = 4^0 and 1 + 3*0 = 4^0. a(43) = 1 since 43^2 = 4^2 + 20^2 + 8^2 + 37^2 with 4 = 4^1 and 4 + 3*20 = 4^3. a(135) = 1 since 135^2 = 16^2 + 16^2 + 17^2 + 132^2 with 16 = 4^2 and 16 + 3*16 = 4^3. a(1103) = 1 since 1103^2 = 4^2 + 4^2 + 716^2 + 839^2 with 4 = 4^1 and 4 + 3*4 = 4^2.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..2000
- 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[(Pow[y]||Pow[4^k-3y])&&SQ[n^2-y^2-(4^k-3y)^2-z^2],r=r+1],{k,0,Log[4,Sqrt[10]*n]},{y,0,Min[n,4^k/3]},{z,0,Sqrt[Max[0,(n^2-y^2-(4^k-3y)^2)/2]]}];tab=Append[tab,r],{n,1,80}];Print[tab]
Comments