A300219 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 both x and 4*x - 3*y are powers of 4 (including 4^0 = 1).
1, 1, 1, 1, 1, 3, 2, 1, 5, 2, 2, 1, 3, 3, 1, 1, 2, 2, 2, 1, 8, 3, 2, 3, 4, 3, 4, 2, 8, 5, 4, 1, 7, 6, 4, 5, 1, 3, 6, 2, 9, 6, 3, 2, 8, 4, 2, 1, 5, 3, 7, 3, 4, 6, 3, 3, 7, 4, 5, 1, 3, 5, 3, 1, 2, 9, 4, 2, 11, 3, 6, 2, 6, 7, 3, 2, 4, 5, 4, 1
Offset: 1
Keywords
Examples
a(2) = 1 since 2^2 = 1^2 + 1^2 + 1^2 + 1^2 with 1 = 4^0 and 4*1 - 3*1 = 4^0. a(3) = 1 since 3^2 = 1^2 + 0^2 + 2^2 + 2^2 with 1 = 4^0 and 4*1 - 3*0 = 4^1. a(5) = 1 since 5^2 = 4^2 + 0^2 + 0^2 + 3^2 with 4 = 4^1 and 4*4 - 3*0 = 4^2. a(15) = 1 since 15^2 = 4^2 + 4^2 + 7^2 + 12^2 with 4 = 4^1 and 4*4 - 3*4 = 4^1. a(37) = 1 since 37^2 = 16^2 + 16^2 + 4^2 + 29^2 with 16 = 4^2 and 4*16 - 3*16 = 4^2. a(83) = 1 since 83^2 = 4^2 + 4^2 + 56^2 + 61^2 with 4 = 4^1 and 4*4 - 3*4 = 4^1. a(263) = 1 since 263^2 = 4^2 + 5^2 + 22^2 + 262^2 with 4 = 4^1 and 4*4 - 3*5 = 4^0.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..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-2018.
Programs
-
Mathematica
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]; Do[r=0;Do[If[SQ[n^2-16^k-((4^(k+1)-4^m)/3)^2-z^2],r=r+1],{k,0,Log[4,n]},{m,Ceiling[Log[4,Max[1,4^(k+1)-3*Sqrt[n^2-16^k]]]],k+1},{z,0,Sqrt[(n^2-16^k-((4^(k+1)-4^m)/3)^2)/2]}];Print[n," ",r];Label[aa],{n,1,80}]
Comments