[go: up one dir, main page]

login
A331217
a(n) is the least prime of the form 2^m - 2^n - 1.
1
2, 5, 3, 7, 47, 31, 191, 127, 16127, 3583, 15359, 6143, 1044479, 8191, 245759, 16744447, 4128767, 131071, 786431, 524287, 274876858367, 14680063, 4398042316799, 260046847, 4278190079, 4261412863, 1125899839733759, 576460752169205759, 16911433727
OFFSET
0,1
LINKS
EXAMPLE
a(1) = 2: 2^2 - 2^0 - 1 = 2, thus exponent 2 = A181692(0);
a(2) = 5: 2^3 - 2^1 - 1 = 5, 2^2 - 2^1 - 1 = 1 is not a prime, A181692(1) = 3;
a(4) = 47: 2^6 - 2^4 - 1 = 31, whereas the first candidate 2^5 - 2^4 - 1 = 15 is composite.
MAPLE
f:= proc(n) local m, p;
p:= -1;
for m from n do
p:= p + 2^m;
if isprime(p) then return p fi
od
end proc:
map(f, [$0..30]); # Robert Israel, Jan 13 2020
MATHEMATICA
a[n_] := For[m = n+1, True, m++, If[PrimeQ[p = 2^m-2^n-1], Return[p]]];
a /@ Range[0, 28] (* Jean-François Alcover, Oct 25 2020 *)
PROG
(PARI) for(n=0, 28, for(m=n+1, oo, k=2^m-2^n-1; if(isprime(k), print1(k, ", "); break)))
(Magma) a:=[]; for n in [0..30] do m:=n+1; while not IsPrime(2^m-2^n-1) do m:=m+1; end while; Append(~a, 2^m-2^n-1); end for; a; // Marius A. Burtea, Jan 13 2020
CROSSREFS
Cf. A181692 (corresponding values of m), A331204, A331205.
Sequence in context: A375552 A192178 A201914 * A021398 A186631 A359478
KEYWORD
nonn
AUTHOR
Hugo Pfoertner, Jan 12 2020
STATUS
approved