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.

A208091 Smallest number m such that exactly n primes of the form 2^m - 2^k - 1 exist, 1 <= k < m.

Original entry on oeis.org

1, 11, 3, 4, 6, 8, 38, 24, 32, 18, 48, 138, 20, 588, 144, 252, 5520, 168, 7200, 2400, 2850
Offset: 0

Views

Author

Reinhard Zumkeller, Feb 23 2012

Keywords

Comments

A208083(a(n)) = n and A208083(m) <> n for m < a(n).
a(21) > 7600, if it exists. - Giovanni Resta, Jun 14 2018

Examples

			a(3) = 4 because for m = 4 there are exactly three primes of the given form: 13 = 2^4 - 2^1 - 1, 11 = 2^4 - 2^2 - 1, 7 = 2^4 - 2^3 - 1 and no smaller m satisfies this requirement.
		

Crossrefs

Cf. A208083.

Programs

  • Haskell
    import Data.List (elemIndices, elemIndex)
    import Data.Maybe (fromJust)
    a208091 = (+ 1) . fromJust . (`elemIndex` a208083_list)
    
  • Maple
    f:= n -> nops(select(k -> isprime(2^n-2^k-1), [$1..n-1])):
    for n from 1 to 300 do
    v:= f(n);
    if not assigned(A[v]) then A[v]:= n fi;
    od:
    seq(A[m],m=0..15); # Robert Israel, Jun 13 2018
  • Mathematica
    A = <||>; Do[c = Length@Select[Range[n-1], PrimeQ[2^n - 2^# - 1] &]; If[! KeyExistsQ[A, c], A[c]=n], {n, 140}]; Array[A, 13, 0] (* Giovanni Resta, Jun 13 2018 *)
  • PARI
    a(n) = {my(m=1); while(sum(k=1, m, isprime(2^m-2^k-1)) != n, m++); m;} \\ Michel Marcus, Jun 13 2018

Extensions

Corrected by Robert Israel, Jun 13 2018
a(17), a(19)-a(20) from Robert Israel, Jun 13 2018
a(16), a(18) from Giovanni Resta, Jun 14 2018