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
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Sep 25 2013
EXTENSIONS
More terms from Peter J. C. Moses
STATUS
approved