login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A298466 The first of two consecutive primes the sum of which is equal to the sum of two consecutive heptagonal numbers. 5
3, 23, 433, 16481, 24593, 167953, 173183, 183871, 192097, 223781, 414521, 447743, 477857, 508951, 513473, 792983, 927803, 996019, 1034251, 1250309, 1285937, 2224063, 2281003, 2456191, 2607109, 2741561, 2773073, 3210353, 3336209, 4206817, 4403647, 4632161 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
23 is in the sequence because 23+29 (consecutive primes) = 52 = 18+34 (consecutive heptagonal numbers).
MATHEMATICA
Module[{hep=Total/@Partition[PolygonalNumber[7, Range[1500]], 2, 1]}, Select[ Partition[Prime[Range[PrimePi[Max[hep]/2]]], 2, 1], MemberQ[hep, Total[#]]&]][[All, 1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 04 2019 *)
PROG
(PARI) L=List(); forprime(p=2, 6000000, q=nextprime(p+1); t=p+q; if(issquare(20*t-16, &sq) && (sq-2)%10==0, u=(sq-2)\10; listput(L, p))); Vec(L)
(Python)
from sympy import prevprime, nextprime
A298466_list, n, m = [], 1 , 8
while len(A298466_list) < 10000:
k = prevprime(m//2)
if k + nextprime(k) == m:
A298466_list.append(k)
n += 1
m += 10*n-3 # Chai Wah Wu, Jan 19 2018
CROSSREFS
Sequence in context: A055326 A271851 A133338 * A358069 A116986 A271962
KEYWORD
nonn
AUTHOR
Colin Barker, Jan 19 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 05:39 EDT 2024. Contains 371235 sequences. (Running on oeis4.)