OFFSET
1,3
COMMENTS
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.
EXAMPLE
a(1) = 0 since 0 = 0^2 + 0^2 with 0 + 3*0 = 0^2.
a(2) = 1 since 1 = 1^2 + 0^2 with 1 + 3*0 = 1^2.
a(3) = 2 since 2 = 1^2 + 1^2 with 1 + 3*1 = 2^2.
a(4) = 5 since 5 = (-2)^2 + 1^2 with (-2) + 3*1 = 1^2.
a(5) = 8 since 8 = (-2)^2 + 2^2 with (-2) + 3*2 = 2^2.
a(6) = 9 since 9 = 0^2 + 3^2 with 0 + 3*3 = 3^2.
a(7) = 10 since 10 = 3^2 + (-1)^2 with 3 + 3*(-1) = 0^2.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
n=0; Do[Do[If[SQ[m-x^2], Do[If[SQ[(-1)^i*x+3(-1)^j*Sqrt[m-x^2]], n=n+1; Print[n, " ", m]; Goto[aa]], {i, 0, Min[x, 1]}, {j, 0, Min[Sqrt[m-x^2], 1]}]], {x, 0, Sqrt[m]}]; Label[aa]; Continue, {m, 0, 281}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Mar 03 2017
STATUS
approved