A282542 Number of ways to write n as x^2 + y^2 + z^2 + w^2 with x,y,z,w nonnegative integers such that x + 3*y + 5*z and (at least) one of y,z,w are squares.
1, 2, 2, 2, 2, 1, 1, 1, 1, 3, 3, 2, 1, 2, 4, 2, 2, 4, 5, 3, 2, 2, 2, 2, 1, 5, 5, 2, 1, 5, 8, 1, 2, 3, 3, 3, 2, 3, 5, 5, 2, 8, 5, 1, 1, 6, 6, 1, 2, 5, 9, 5, 4, 2, 5, 5, 2, 5, 4, 5, 2, 1, 5, 3, 2, 7, 9, 5, 2, 3, 6, 2, 2, 8, 9, 5, 3, 5, 9, 2, 1
Offset: 0
Keywords
Examples
a(12) = 1 since 12 = 1^2 + 1^2 + 1^2 + 3^2 with 1 + 3*1 + 5*1 = 3^2 and 1 = 1^2. a(28) = 1 since 28 = 1^2 + 1^2 + 1^2 + 5^2 with 1 + 3*1 + 5*1 = 3^2 and 1 = 1^2. a(47) = 1 since 47 = 3^2 + 1^2 + 6^2 + 1^2 with 3 + 3*1 + 5*6 = 6^2 and 1 = 1^2. a(92) = 1 since 92 = 1^2 + 1^2 + 9^2 + 3^2 with 1 + 3*1 + 5*1 = 3^2 and 9 = 3^2. a(188) = 1 since 188 = 7^2 + 9^2 + 3^2 + 7^2 with 7 + 3*9 + 5*3 = 7^2 and 9 = 3^2. a(248) = 1 since 248 = 10^2 + 2^2 + 0^2 + 12^2 with 10 + 3*2 + 5*0 = 4^2 and 0 = 0^2. a(388) = 1 since 388 = 13^2 + 1^2 + 13^2 + 7^2 with 13 + 3*1 + 5*13 = 9^2 and 1 = 1^2.
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]]; Do[r=0;Do[If[SQ[n-x^2-y^2-z^2]&&(SQ[y]||SQ[z]||SQ[Sqrt[n-x^2-y^2-z^2]])&&SQ[x+3y+5z],r=r+1],{x,0,n^(1/2)},{y,0,Sqrt[n-x^2]},{z,0,Sqrt[n-x^2-y^2]}];Print[n," ",r];Continue,{n,0,80}]
Comments