cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A298251 The first of three consecutive primes the sum of which is equal to the sum of three consecutive pentagonal numbers.

This page as a plain text file.
%I A298251 #18 Dec 12 2020 17:33:01
%S A298251 199,35951,46351,69221,88427,230291,490481,707573,829883,1088419,
%T A298251 1129693,1258109,1736101,1918157,1976243,2456939,2741159,2753351,
%U A298251 2822881,3249419,4603351,5121713,5528623,6186407,6664429,6945559,6964949,7094839,7120963,7147121
%N A298251 The first of three consecutive primes the sum of which is equal to the sum of three consecutive pentagonal numbers.
%H A298251 Robert Israel, <a href="/A298251/b298251.txt">Table of n, a(n) for n = 1..2352</a>
%e A298251 199 is in the sequence because 199+211+223 (consecutive primes) = 633 = 176+210+247 (consecutive pentagonal numbers).
%p A298251 N:= 10^8: # to get all terms where the sums <= N
%p A298251 Res:= NULL:
%p A298251 mmax:= floor((sqrt(8*N-23)-5)/6):
%p A298251 M3:= map(t->9/2*t^2+15/2*t+6, [seq(seq(4*i+j,j=2..3),i=0..mmax/4)]):
%p A298251 for m in M3 do
%p A298251   r:= ceil((m-8)/3);
%p A298251   p1:= prevprime(r+1);
%p A298251   p2:= nextprime(p1);
%p A298251   p3:= nextprime(p2);
%p A298251   while p1+p2+p3 > m do
%p A298251     p3:= p2; p2:= p1; p1:= prevprime(p1);
%p A298251   od:
%p A298251   if p1+p2+p3 = m then
%p A298251     Res:= Res, p1
%p A298251   fi
%p A298251 od:
%p A298251 Res; # _Robert Israel_, Jan 16 2018
%t A298251 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 *)
%o A298251 (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)
%Y A298251 Cf. A000040, A000326, A054643, A298073, A298168, A298169, A298222, A298223, A298250.
%K A298251 nonn
%O A298251 1,1
%A A298251 _Colin Barker_, Jan 15 2018