OFFSET
1,1
MAPLE
A024612 := proc(n)
local i, j, disc;
# n=i^2+j^2-i*j = (j-i)^2+i*j, 1<=i<j
# so (j-i)>=1 and i*j>=j and i^2+j^2-i*j >= 1+j max search radius
for j from 2 to n-1 do
# i=(j +- sqrt(4n-3j^2))/2
disc := 4*n-3*j^2 ;
if disc >= 0 then
if issqr(disc) then
i := (j+sqrt(disc))/2 ;
if type(i, 'integer') and i >= 1 and i<j then
printf("%d, ", n) ;
end if;
if disc > 0 then
i := (j-sqrt(disc))/2 ;
if type(i, 'integer') and i >= 1 and i<j then
printf("%d, ", n) ;
end if;
end if;
end if;
end if;
end do:
end proc:
for t from 1 to 120 do
A024612(t);
end do: # R. J. Mathar, Aug 21 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved