OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..2352
EXAMPLE
199 is in the sequence because 199+211+223 (consecutive primes) = 633 = 176+210+247 (consecutive pentagonal numbers).
MAPLE
N:= 10^8: # to get all terms where the sums <= N
Res:= NULL:
mmax:= floor((sqrt(8*N-23)-5)/6):
M3:= map(t->9/2*t^2+15/2*t+6, [seq(seq(4*i+j, j=2..3), i=0..mmax/4)]):
for m in M3 do
r:= ceil((m-8)/3);
p1:= prevprime(r+1);
p2:= nextprime(p1);
p3:= nextprime(p2);
while p1+p2+p3 > m do
p3:= p2; p2:= p1; p1:= prevprime(p1);
od:
if p1+p2+p3 = m then
Res:= Res, p1
fi
od:
Res; # Robert Israel, Jan 16 2018
MATHEMATICA
Module[{nn=50000, pn}, pn=Total/@Partition[PolygonalNumber[5, Range[ Ceiling[ (1+Sqrt[1+24 Prime[nn]])/6]]], 3, 1]; Select[Partition[ Prime[ Range[ nn]], 3, 1], MemberQ[pn, Total[#]]&]][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 12 2020 *)
PROG
(PARI) L=List(); forprime(p=2, 8000000, q=nextprime(p+1); r=nextprime(q+1); t=p+q+r; if(issquare(72*t-207, &sq) && (sq-15)%18==0, u=(sq-15)\18; listput(L, p))); Vec(L)
CROSSREFS
KEYWORD
nonn
AUTHOR
Colin Barker, Jan 15 2018
STATUS
approved