A301858 Positive integers which can be written as the sum of two squares but cannot be written as x^2 + y^2 + 2*z^2 with x and y integers and z a nonzero integer.
1, 5, 29, 65
Offset: 1
Keywords
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..4
Programs
-
Mathematica
f[n_]:=f[n]=FactorInteger[n]; g[n_]:=g[n]=Sum[Boole[Mod[Part[Part[f[n],i],1],4]==3&&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[If[QQ[m]==False,Goto[aa]];Do[If[SQ[m-2x^2-y^2],Goto[aa]],{x,1,Sqrt[m/2]},{y,0,Sqrt[(m-2x^2)/2]}];tab=Append[tab,m];Label[aa],{m,1,1000}];Print[tab]
Comments