login
A130621
List the first term of each triple of consecutive primes with the property that their sum is the square of a prime.
2
13, 37, 277, 313, 613, 7591, 8209, 12157, 23053, 32233, 42953, 44887, 105649, 225769, 245941, 258707, 287671, 331333, 342049, 346111, 347443, 393853, 560719, 721267, 867253, 1001089, 1064431, 1219849, 1545127, 1556623, 1617727, 1752607
OFFSET
1,1
LINKS
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
Sequence in context: A266882 A078952 A206279 * A309594 A098265 A195540
KEYWORD
nonn
AUTHOR
J. M. Bergot, Jun 18 2007
EXTENSIONS
Edited and extended by Stefan Steinerberger, Jun 23 2007
STATUS
approved