OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..3000
EXAMPLE
(37, 41, 43) is a triple of consecutive prime numbers; their sum is 121 which is a prime squared. Hence 37 is in the sequence.
MAPLE
f:= proc(n) local p, q, r;
q:= prevprime(floor(n/3));
p:= prevprime(q);
r:= nextprime(q);
if p+q+r = n then return p
elif p+q+r < n then
while p+q+r < n do
p:= q; q:= r; r:= nextprime(r);
od;
if p+q+r = n then return p fi
else
while p+q+r > n do
r:= q; q:= p; p:= prevprime(p);
od;
if p+q+r = n then return p fi;
fi;
false
end proc:
R:= NULL: count:= 0:
p:= 3:
while count < 100 do
p:= nextprime(p);
v:= f(p^2);
if v::integer then
R:= R, v; count:= count+1;
fi
od:
R; # Robert Israel, Sep 18 2022
MATHEMATICA
a={}; For[n=1, n<100000, n++, If[PrimeQ[Sqrt[Prime[n]+Prime[n+1]+Prime[n+2]]], AppendTo[a, Prime[n]]]]; a
Select[Partition[Prime[Range[132000]], 3, 1], PrimeQ[Sqrt[Total[#]]]&][[All, 1]] (* Harvey P. Dale, Dec 12 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
J. M. Bergot, Jun 18 2007
EXTENSIONS
Edited and extended by Stefan Steinerberger, Jun 23 2007
STATUS
approved