login
A298464
The first of two consecutive primes the sum of which is equal to the sum of two consecutive pentagonal numbers.
5
79, 3643, 10909, 37123, 56053, 70849, 78889, 125551, 178877, 209063, 258743, 330409, 350411, 395261, 439559, 469279, 479387, 499969, 620813, 663997, 754723, 828811, 878597, 901709, 1026709, 1087147, 1170397, 1202429, 1213189, 1234873, 1340477, 1510013
OFFSET
1,1
EXAMPLE
79 is in the sequence because 79+83 (consecutive primes) = 162 = 70+92 (consecutive pentagonal numbers).
MATHEMATICA
Block[{s = Total /@ Partition[PolygonalNumber[5, Range[10^3]], 2, 1], t}, t = Partition[Prime@ Range@ PrimePi[2 Last[s]], 2, 1]; Select[t, MemberQ[s, Total@ #] &][[All, 1]]] (* Michael De Vlieger, Jan 21 2018 *)
PROG
(PARI) L=List(); forprime(p=2, 1600000, q=nextprime(p+1); t=p+q; if(issquare(12*t-8, &sq) && (sq-2)%6==0, u=(sq-2)\6; listput(L, p))); Vec(L)
(Python)
from __future__ import division
from sympy import prevprime, nextprime
A298464_list, n, m = [], 1 , 6
while len(A298464_list) < 10000:
k = prevprime(m//2)
if k + nextprime(k) == m:
A298464_list.append(k)
n += 1
m += 6*n-1 # Chai Wah Wu, Jan 20 2018
KEYWORD
nonn
AUTHOR
Colin Barker, Jan 19 2018
STATUS
approved