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.

A298466 The first of two consecutive primes the sum of which is equal to the sum of two consecutive heptagonal numbers.

This page as a plain text file.
%I A298466 #20 Oct 12 2023 13:38:08
%S A298466 3,23,433,16481,24593,167953,173183,183871,192097,223781,414521,
%T A298466 447743,477857,508951,513473,792983,927803,996019,1034251,1250309,
%U A298466 1285937,2224063,2281003,2456191,2607109,2741561,2773073,3210353,3336209,4206817,4403647,4632161
%N A298466 The first of two consecutive primes the sum of which is equal to the sum of two consecutive heptagonal numbers.
%H A298466 Chai Wah Wu, <a href="/A298466/b298466.txt">Table of n, a(n) for n = 1..10000</a>
%e A298466 23 is in the sequence because 23+29 (consecutive primes) = 52 = 18+34 (consecutive heptagonal numbers).
%t A298466 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 *)
%o A298466 (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)
%o A298466 (Python)
%o A298466 from sympy import prevprime, nextprime
%o A298466 A298466_list, n, m = [], 1 ,8
%o A298466 while len(A298466_list) < 10000:
%o A298466     k = prevprime(m//2)
%o A298466     if k + nextprime(k) == m:
%o A298466         A298466_list.append(k)
%o A298466     n += 1
%o A298466     m += 10*n-3 # _Chai Wah Wu_, Jan 19 2018
%Y A298466 Cf. A000040, A000566, A061275, A298462, A298463, A298464, A298465.
%K A298466 nonn
%O A298466 1,1
%A A298466 _Colin Barker_, Jan 19 2018