OFFSET
1,2
MAPLE
lis:={}; lisP:={}; lisI:={};
M:=50; M2:=M^2;
for x from 0 to M do
x2:=x^2;
for y from 0 to M do
N:=x2+2*y^2;
if N <= M2 then
if gcd(x, y) = 1 then lisP:={op(lisP), N}; else lisI:={op(lisI), N} fi;
lis:={op(lis), N};
fi;
od: od:
lprint("lis");
Lis:=sort(convert(lis, list));
lprint("lisP");
LisP:=sort(convert(lisP, list));
lprint("lisI");
LisI:=sort(convert(lisI, list));
lprint("lisPnotI");
LisPnotI:=sort(convert(lisP minus lisI, list));
lprint("lisInotP");
LisInotP:=sort(convert(lisI minus lisP, list));
lprint("lisIandP");
LisIandP:=sort(convert(lisI intersect lisP, list));
lprint("liseither");
Liseither:=sort(convert(lis minus (lisI intersect lisP), list));
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Corrected by N. J. A. Sloane, Apr 30 2015
STATUS
approved