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!)
A089637 Smallest member of a pair of consecutive twin prime pairs that have exactly n primes between them. 5

%I #37 Feb 21 2023 10:51:20

%S 3,17,41,107,71,2267,1091,461,1319,1151,347,5741,2999,5279,10139,1487,

%T 9461,881,659,13007,9041,15359,8627,28751,83717,13397,18539,14627,

%U 44771,54011,60257,59669,142157,77711,61559,178931,26261,122867,293261,89069,24419,167861

%N Smallest member of a pair of consecutive twin prime pairs that have exactly n primes between them.

%C Smallest prime p such that n primes exist between the twin prime pair (p, p+2) and the next twin prime pair.

%C If this sequence is well defined then the Twin Prime Conjecture is true. - _David A. Corneth_, Dec 27 2019

%H David A. Corneth, <a href="/A089637/b089637.txt">Table of n, a(n) for n = 0..342</a> (terms n = 1..226 from and terms > 10^12 from Amiram Eldar)

%H David A. Corneth and Amiram Eldar, <a href="/A089637/a089637_1.gp.txt">Terms <= 1.5*10^12 (0 indicates the term is > 1.5*10^12</a> (terms > 10^12 from Amiram Eldar)

%e a(0) = 3 since there is no prime between the twin primes (3, 5) and (5, 7). - _David A. Corneth_, Dec 27 2019

%e a(1) = 17 since there is one prime, 23, between the twin primes (17, 19) and (29, 31).

%e a(2) = 41 since there are 2 primes, 47 and 53, between the twin primes (41, 43) and (59, 61).

%p A181981 := proc(n)

%p local j,hi,lo ;

%p if n = 0 then

%p 3;

%p else

%p for j from 1 do

%p hi := numtheory[pi](A001359(j+1)) ;

%p lo := numtheory[pi](A006512(j)) ;

%p if hi-lo = n+1 then

%p return A001359(j);

%p end if;

%p end do:

%p end if;

%p end proc: # _R. J. Mathar_, Jul 03 2012

%t countPrimes[pin_] := Module[{prv = pin, c = 0, p}, p = NextPrime[prv]; While[p != prv + 2, c++; prv = p; p = NextPrime[p]]; {c-1, p}]; p = 13; mx = 20; c = 0; seq = Table[0, {mx}]; While[c < mx, cp = countPrimes[p]; i = cp[[1]]; If[i > 0 && i <= mx && seq[[i]] == 0, c++; seq[[i]] = p - 2]; p = cp[[2]]]; seq (* _Amiram Eldar_, Dec 26 2019 *)

%o (PARI) pbetweentw(n) = /* p is the number of primes between */ { for(p=0, 100, forstep(x1=1, n, 1, my(c=0, t1 = twin[x1], t2 = twin[x1+1]); for(y=t1+4, t2-1, if(isprime(y), c++) ); if(c==p, print1(t1", "); break) ) ) }

%o savetwins(n) = /* Build a twin prime table of lower bounds */ { twin = vector(n); my(c=1); forprime(x=3, n*10, if(isprime(x+2), twin[c]=x; c++; ) ) }

%Y Cf. A001097, A001359, A006512, A027833.

%K nonn

%O 0,1

%A _Cino Hilliard_, Jan 01 2004

%E Offset corrected and data corrected and expanded by _Amiram Eldar_, Dec 26 2019

%E a(0) = 3 prepended by _David A. Corneth_, Dec 27 2019

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 April 16 11:08 EDT 2024. Contains 371711 sequences. (Running on oeis4.)