OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..103 (conjectured to be all the terms)
C. Güllü et al, Mathematics StackExchange, "Primes that don't give a square when added any of the primes less than them", Jan 2023.
EXAMPLE
2 + 2 = 4, so 2 is not in the sequence.
7 + 2 = 9, so 7 is not in the sequence.
3 + 2 = 5 and 3 + 3 = 6. 5 and 6 are not squares, so 3 is a term.
17 + 2 = 19, 17 + 3 = 20, 17 + 5 = 22, 17 + 7 = 24, 17 + 11 = 28, 17 + 13 = 30, 17 + 17 = 34. All these are nonsquares, so 17 is a term.
MAPLE
filter:= proc(p) local s, s0, q;
if issqr(p+2) then return false fi;
s0:= floor(sqrt(p));
if s0::odd then s0:= s0-1 fi;
for s from s0+2 by 2 do
q:= s^2-p;
if q > p then return true fi;
if isprime(q) then return false fi;
od;
end proc:
R:= NULL: p:= 1:
while p < 10^7 do
p:= nextprime(p);
if filter(p) then R:= R, p; fi;
od:
R; # Robert Israel, Jan 10 2023
MATHEMATICA
aQ[p_] := PrimeQ[p] && Module[{q = 2}, While[q <= p && !IntegerQ[Sqrt[p + q]], q = NextPrime[q]]; q > p]; Select[Range[1000], aQ] (* Amiram Eldar, Dec 04 2018 *)
PROG
(PARI) isok(p) = {if (! isprime(p), return (0)); forprime(q=2, p, if (issquare(p+q), return (0)); ); return (1); } \\ Michel Marcus, Oct 18 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Marius A. Burtea, Oct 13 2018
STATUS
approved