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

 Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 60th year, we have over 367,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”). Other ways to Give
 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A229512 a(n) is the minimal k such that nextprime(2k+1) - 2k = prime(n) where nextprime(n) is least prime > n. 1
 0, 1, 3, 11, 58, 57, 262, 261, 564, 666, 665, 4775, 7843, 7842, 9807, 9804, 15705, 15704, 15701, 15699, 15698, 77964, 77962, 180330, 180326, 185136, 185135, 185133, 185132, 185130, 678603, 678601, 1005372, 1005371, 1005366, 2326178, 8525865, 8525862, 8525860 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,3 COMMENTS It is interesting to note the distribution of terms over groups of close magnitudes. For example, 58,57; 9807,9804;, 15704,15701,15699,15698; etc. Is there an explanation? If a(n+1) = a(n) - 1 and 2*a(n) + 1 is not prime, then (prime(n), prime(n+1)) is twin pair. We call a twin pair (prime(n)), prime(n+1)) regular, if a(n+1) = a(n) - 1, and irregular otherwise. The first irregular pairs are (3,5),(5,7),(149,151),... From Chai Wah Wu, Feb 27 2018: (Start) a(n) exists for all n since the prime gap can be arbitrarily large. If k > 0 is a term, then p <= 2k+1 < nextprime(p) for some prime p in A002386. In this case, for k = (p-1)/2, nextprime(2*m+1) - 2*m = g - 2*(m-k) for k <= m < k + (g-1)/2 where g = nextprime(p) - p + 1. For large g, this set of numbers m will include a few terms of the sequence (as g - 2*(m-k) will cover some primes not yet found) which result in the clusters of terms observed. (End) LINKS Chai Wah Wu, Table of n, a(n) for n = 1..240 MATHEMATICA Table[Block[{k = 0}, While[NextPrime[2 k + 1] - 2 k != p, k++]; k], {p, Prime@ Range@ 30}] (* Michael De Vlieger, Feb 28 2018 *) PROG (PARI) a(n) = my(k = 0, p = prime(n)); while (nextprime(2*k+2) - 2*k != p, k++); k \\ Michel Marcus, Sep 25 2013 CROSSREFS Cf. A000040, A002386, A151800. Sequence in context: A001586 A126201 A261643 * A208990 A020012 A126100 Adjacent sequences: A229509 A229510 A229511 * A229513 A229514 A229515 KEYWORD nonn AUTHOR Vladimir Shevelev, Sep 25 2013 EXTENSIONS More terms from Peter J. C. Moses 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.

Last modified December 8 07:12 EST 2023. Contains 367662 sequences. (Running on oeis4.)