OFFSET
0,1
MATHEMATICA
okQ[n_] := (xy = {x, y} /. {ToRules[Reduce[n == x^2 + y^2, {x, y}, Integers]]}; cnt = Count[xy, {x_, y_} /; GCD[x, y] == 1]; Length[xy] > cnt > 0); Reap[For[n = 1, n <= 3000, n++, If[okQ[n], Print[n]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, Jan 25 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved