OFFSET
1,2
COMMENTS
It might seem that 1 is the only square in this sequence, but 5884015571^2 is also a term of this sequence.
See also A301471 for related information.
It is known that a positive integer n has the form x^2 + 2*y^2 with x and y integers if and only if the p-adic order of n is even for any prime p == 5 or 7 (mod 8).
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.
EXAMPLE
a(1) = 1 and a(2) = 2 since x^2 + 2*y^2 + 3*2^z > 2 for all x,y,z = 0,1,2,....
MATHEMATICA
f[n_]:=f[n]=FactorInteger[n];
g[n_]:=g[n]=Sum[Boole[(Mod[Part[Part[f[n], i], 1], 8]==5||Mod[Part[Part[f[n], i], 1], 8]==7)&&Mod[Part[Part[f[n], i], 2], 2]==1], {i, 1, Length[f[n]]}]==0;
QQ[n_]:=QQ[n]=(n==0)||(n>0&&g[n]);
SQ[n_]:=SQ[n]=IntegerQ[Sqrt[n]];
tab={}; Do[Do[If[QQ[m-3*2^k], Goto[aa]], {k, 0, Log[2, m/3]}]; tab=Append[tab, m]; Label[aa], {m, 1, 1293}]; Print[tab]
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Mar 21 2018
STATUS
approved