OFFSET
1,2
COMMENTS
65213 is the first positive integer which cannot be written as x^2 + y^2 + z^2 + w^2 with x,y,z,w integers such that both x and x + y + z are powers of two. Though a(44997) = 0, we have
44997 = 128^2 + (-28)^2 + (-98)^2 + 1^2 with 128 = 2^7 and 128 + (-28) + (-98) = 2^1.
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) = 1 since 1 = 1^2 + 0^2 + 0^2 + 0^2 with 1 = 2^0 and 1 + 0 - 0 = 2^0.
a(2237) = 1 since 2237 = 8^2 + 29^2 + 36^2 + 6^2 with 8 = 2^3 and 8 + 29 - 36 = 2^0.
a(4397) = 1 since 4397 = 4^2 + 21^2 + 24^2 + 58^2 with 4 = 2^2 and 4 + 21 - 24 = 2^0.
a(5853) = 1 since 5853 = 2^2 + 52^2 + 52^2 + 21^2 with 2 = 2^1 and 2 + 52 - 52 = 2^1.
a(14711) = 1 since 14711 = 1^2 + 18^2 + 15^2 + 119^2 with 1 = 2^0 and 1 + 18 - 15 = 2^2.
a(16797) = 1 since 16797 = 64^2 + 42^2 + 104^2 + 11^2 with 64 = 2^6 and 64 + 42 - 104 = 2^1.
a(17861) = 1 since 17861 = 32^2 + 0^2 + 31^2 + 126^2 with 32 = 2^5 and 32 + 0 - 31 = 2^0.
a(20959) = 1 since 20959 = 2^2 + 109^2 + 95^2 + 7^2 with 2 = 2^1 and 2 + 109 - 95 = 2^4.
a(21799) = 1 since 21799 = 1^2 + 146^2 + 19^2 + 11^2 with 1 = 2^0 and 1 + 146 - 19 = 2^7.
a(24757) = 1 since 24757 = 64^2 + 56^2 + 119^2 + 58^2 with 64 = 2^6 and 64 + 56 - 119 = 2^0.
a(28253) = 1 since 28253 = 2^2 + 3^2 + 4^2 + 168^2 with 2 = 2^1 and 2 + 3 - 4 = 2^0.
MATHEMATICA
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
Pow[n_]:=Pow[n]=n>0&&IntegerQ[Log[2, n]];
Do[r=0; Do[If[SQ[n-4^x-y^2-z^2]&&Pow[2^x+y-z], r=r+1], {x, 0, Log[4, n]}, {y, 0, Sqrt[n-4^x]}, {z, 0, Sqrt[n-4^x-y^2]}]; Print[n, " ", r]; Continue, {n, 1, 80}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Feb 02 2017
STATUS
approved