login
A365160
Least k such that A000668(n) + k is prime, where A000668(n) is the n-th Mersenne prime.
2
2, 4, 6, 4, 18, 30, 22, 12, 16, 30, 40, 30, 888, 486, 2056, 696, 310, 718, 4692, 1600, 2788, 4290, 4326, 4150, 18088, 22096, 16342, 72816, 181720, 4200, 58416
OFFSET
1,1
COMMENTS
The distance between the n-th Mersenne prime and the next prime.
FORMULA
a(n) = A001223(A059305(n)). - Michel Marcus, Aug 25 2023
a(n) = A074626(n) - A000668(n). - Amiram Eldar, Aug 10 2024
EXAMPLE
A000668(6) = 131071, the next prime is 131101, so a(6) = 131101 - 131071 = 30.
MATHEMATICA
m[n_] := m[n] = (2^MersennePrimeExponent[n] - 1); a[k_, n_] := a[k, n] = m[n] + k; l[k_, n_] := l[k, n] = PrimeQ[a[k, n]]; Table[k = 1; Monitor[Parallelize[While[True, If[l[k, n], Break[]]; k++]; k], {n, k}], {n, 1, 20}]
CROSSREFS
Cf. A000040, A000668 (Mersenne primes), A001223, A059305, A074626, A365161.
Sequence in context: A353512 A257080 A099784 * A082747 A127275 A242796
KEYWORD
nonn,hard,more
AUTHOR
Robert P. P. McKone, Aug 24 2023
EXTENSIONS
a(28) from Michael S. Branicky, Aug 11 2024
a(29) from Minfeng Wang, Oct 29 2024
a(30)-a(31) from Minfeng Wang, Oct 29 2024
STATUS
approved