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.
%I A331217 #20 Sep 08 2022 08:46:25 %S A331217 2,5,3,7,47,31,191,127,16127,3583,15359,6143,1044479,8191,245759, %T A331217 16744447,4128767,131071,786431,524287,274876858367,14680063, %U A331217 4398042316799,260046847,4278190079,4261412863,1125899839733759,576460752169205759,16911433727 %N A331217 a(n) is the least prime of the form 2^m - 2^n - 1. %H A331217 Robert Israel, <a href="/A331217/b331217.txt">Table of n, a(n) for n = 0..680</a> %e A331217 a(1) = 2: 2^2 - 2^0 - 1 = 2, thus exponent 2 = A181692(0); %e A331217 a(2) = 5: 2^3 - 2^1 - 1 = 5, 2^2 - 2^1 - 1 = 1 is not a prime, A181692(1) = 3; %e A331217 a(4) = 47: 2^6 - 2^4 - 1 = 31, whereas the first candidate 2^5 - 2^4 - 1 = 15 is composite. %p A331217 f:= proc(n) local m, p; %p A331217 p:= -1; %p A331217 for m from n do %p A331217 p:= p + 2^m; %p A331217 if isprime(p) then return p fi %p A331217 od %p A331217 end proc: %p A331217 map(f, [$0..30]); # _Robert Israel_, Jan 13 2020 %t A331217 a[n_] := For[m = n+1, True, m++, If[PrimeQ[p = 2^m-2^n-1], Return[p]]]; %t A331217 a /@ Range[0, 28] (* _Jean-François Alcover_, Oct 25 2020 *) %o A331217 (PARI) for(n=0,28, for(m=n+1,oo, k=2^m-2^n-1; if(isprime(k), print1(k,", "); break))) %o A331217 (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 %Y A331217 Cf. A181692 (corresponding values of m), A331204, A331205. %K A331217 nonn %O A331217 0,1 %A A331217 _Hugo Pfoertner_, Jan 12 2020