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.

Showing 1-2 of 2 results.

A331205 a(n) = least prime of the form 2^m - 2^n + 1.

Original entry on oeis.org

2, 3, 5, 549755813881, 17, 97, 193, 140737488355201, 257, 7681, 15361, 134215681, 12289, 8380417, 114689
Offset: 0

Views

Author

Hugo Pfoertner, Jan 12 2020

Keywords

Comments

a(15) = 2^447 - 2^15 + 1 is too large to be represented in the data.

Examples

			See A331204.
		

Crossrefs

Cf. A181692, A331204 (corresponding values of m).

Programs

  • PARI
    for(n=0,14, for(m=n+1,oo, k=2^m-2^n+1; if(isprime(k), print1(k,", "); break)))

A331217 a(n) is the least prime of the form 2^m - 2^n - 1.

Original entry on oeis.org

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

Views

Author

Hugo Pfoertner, Jan 12 2020

Keywords

Examples

			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.
		

Crossrefs

Cf. A181692 (corresponding values of m), A331204, A331205.

Programs

  • 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
  • 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 *)
  • PARI
    for(n=0,28, for(m=n+1,oo, k=2^m-2^n-1; if(isprime(k), print1(k,", "); break)))
    
Showing 1-2 of 2 results.