OFFSET
1,1
COMMENTS
If a composite number C can be written in the form C = a^2 + k*b^2, for some integers a and b, then every prime factor P (for C) being raised to an odd power can be written in the form P = c^2 + k*d^2, for some integers c and d.
This statement is only true for k = 1, 2, 3.
For k = 7, with the exception of the prime factor 2, the statement mentioned above is true.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
filter:= proc(n) local L, x, y;
select(t -> subs(t, x*y) > 0, [isolve(n^2=x^2+y^2)]) <> []
and select(t -> subs(t, x*y) > 0, [isolve(n^2=x^2+2*y^2)]) <> []
and select(t -> subs(t, x*y) > 0, [isolve(n^2=x^2+3*y^2)]) <> []
and select(t -> subs(t, x*y) > 0, [isolve(n^2=x^2+7*y^2)]) <> []
end proc:
select(filter, [$1..1000]); # Robert Israel, May 03 2018
MATHEMATICA
okQ[n_] := Module[{x, y}, AllTrue[{1, 2, 3, 7}, Solve[x > 0 && y > 0 && n^2 == x^2 + #*y^2, {x, y}, Integers] =!= {}&]];
Select[Range[1000], okQ] (* Jean-François Alcover, May 23 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
V. Raman, Sep 17 2012
STATUS
approved