OFFSET
1,4
COMMENTS
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
Zhi-Wei Sun, Refining Lagrange's four-square theorem, arXiv:1604.06723 [math.GM], 2016.
EXAMPLE
a(8) = 1 since 8 = 4*(1+0^2+0^2) + 2^2 with 0+0 even.
a(31) = 1 since 31 = 4^0*(1+1^2+5^2) + 2^2 with 1+5 even.
a(47) = 1 since 47 = 4^0*(1+1^2+3^2) + 6^2 with 1+3 even.
a(79) = 1 since 79 = 4^0*(1+5^2+7^2)+2^2 with 5+7 even.
a(1009) = 1 since 1009 = 4^2*(1+1^2+1^2) + 31^2 with 1+1 even.
a(7793) = 1 since 7793 = 4^2*(1+12^2+18^2) + 17^2 with 12+18 even.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]]
Do[r=0; Do[If[SQ[n-4^k*(1+2x^2+2y^2)], r=r+1], {k, 0, Log[4, n]}, {x, 0, Sqrt[(n/4^k-1)/4]}, {y, x, Sqrt[(n/4^k-1-2x^2)/2]}]; Print[n, " ", r]; Continue, {n, 1, 80}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Aug 11 2016
STATUS
approved