cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A365160 Least k such that A000668(n) + k is prime, where A000668(n) is the n-th Mersenne prime.

This page as a plain text file.
%I A365160 #41 Oct 30 2024 21:57:33
%S A365160 2,4,6,4,18,30,22,12,16,30,40,30,888,486,2056,696,310,718,4692,1600,
%T A365160 2788,4290,4326,4150,18088,22096,16342,72816,181720,4200,58416
%N A365160 Least k such that A000668(n) + k is prime, where A000668(n) is the n-th Mersenne prime.
%C A365160 The distance between the n-th Mersenne prime and the next prime.
%F A365160 a(n) = A001223(A059305(n)). - _Michel Marcus_, Aug 25 2023
%F A365160 a(n) = A074626(n) - A000668(n). - _Amiram Eldar_, Aug 10 2024
%e A365160 A000668(6) = 131071, the next prime is 131101, so a(6) = 131101 - 131071 = 30.
%t A365160 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}]
%Y A365160 Cf. A000040, A000668 (Mersenne primes), A001223, A059305, A074626, A365161.
%K A365160 nonn,hard,more
%O A365160 1,1
%A A365160 _Robert P. P. McKone_, Aug 24 2023
%E A365160 a(28) from _Michael S. Branicky_, Aug 11 2024
%E A365160 a(29) from _Minfeng Wang_, Oct 29 2024
%E A365160 a(30)-a(31) from _Minfeng Wang_, Oct 29 2024