OFFSET
1,1
LINKS
Max Alekseyev, Table of n, a(n) for n = 1..100
EXAMPLE
For 73 = 3^2 + 8^2 we have 2^9 == 1 (mod 73) and 2^64 == 2 (mod 73).
MAPLE
f:= proc(p) local F, x, y;
if not isprime(p) then return false fi;
if issqr(p-1) then return false fi;
F:= GaussInt:-GIfactors(p)[2];
x, y:= (Re, Im)(F[1][1]);
2 &^ (x^2) mod p = 1 or 2 &^ (y^2) mod p = 1
end proc:
select(f, [seq(i, i=5..10^7, 4)]); # Robert Israel, Feb 02 2018
MATHEMATICA
pmax = 8000000;
xmax = Ceiling@ Sqrt@ pmax;
Table[p = x^2 + y^2; If[p <= pmax && PrimeQ[p] && (PowerMod[2, x^2, p] == 1 || PowerMod[2, y^2, p] == 1), p, Nothing], {x, 2, xmax}, {y, 2, x}] // Flatten // Union (* Jean-François Alcover, Oct 16 2020 *)
PROG
(PARI) B=bnfinit(x^2+1); { is_A299103(p) = my(z); if(p%4!=1 || issquare(p-1), return(0)); z=abs(Vec(bnfisintnorm(B, p)[1])); Mod(2, p)^(z[1]^2)==1 || Mod(2, p)^(z[2]^2)==1; } \\ Max Alekseyev, Feb 02 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Thomas Ordowski, Feb 02 2018
EXTENSIONS
Terms a(7) onward from Max Alekseyev, Feb 02 2018
STATUS
approved