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.

A365161 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 A365161 #42 Oct 30 2024 22:01:15
%S A365161 1,2,2,14,12,8,18,18,30,20,170,24,114,56,156,2510,1824,12,3980,3630,
%T A365161 16902,284,7712,20022,12930,9698,16232,1058,256016,23712,26298
%N A365161 Least k such that A000668(n) - k is prime, where A000668(n) is the n-th Mersenne prime.
%C A365161 The distance between the n-th Mersenne prime and the previous prime.
%F A365161 a(n) = A001223(A059305(n)-1). - _Michel Marcus_, Aug 25 2023
%F A365161 a(n) = A000668(n) - A073715(n). - _Amiram Eldar_, Aug 10 2024
%e A365161 A000668(6) = 131071, the previous prime is 131063, so a(6) = 131071 - 131063 = 8.
%t A365161 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 A365161 Cf. A000040, A000668 (Mersenne primes), A001223, A059305, A073715, A365160.
%K A365161 nonn,hard,more
%O A365161 1,2
%A A365161 _Robert P. P. McKone_, Aug 24 2023
%E A365161 a(29)-a(31) from _Michael S. Branicky_, Sep 01 2024