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!)
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
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
Sequence in context: A001586 A126201 A261643 * A208990 A020012 A126100
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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 16 23:15 EDT 2024. Contains 375195 sequences. (Running on oeis4.)