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

%I #24 Jun 14 2018 01:39:24

%S 1,11,3,4,6,8,38,24,32,18,48,138,20,588,144,252,5520,168,7200,2400,

%T 2850

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

%C A208083(a(n)) = n and A208083(m) <> n for m < a(n).

%C a(21) > 7600, if it exists. - _Giovanni Resta_, Jun 14 2018

%e 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.

%p f:= n -> nops(select(k -> isprime(2^n-2^k-1), [$1..n-1])):

%p for n from 1 to 300 do

%p v:= f(n);

%p if not assigned(A[v]) then A[v]:= n fi;

%p od:

%p seq(A[m],m=0..15); # _Robert Israel_, Jun 13 2018

%t 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 *)

%o (Haskell)

%o import Data.List (elemIndices, elemIndex)

%o import Data.Maybe (fromJust)

%o a208091 = (+ 1) . fromJust . (`elemIndex` a208083_list)

%o (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

%Y Cf. A208083.

%K nonn,more

%O 0,2

%A _Reinhard Zumkeller_, Feb 23 2012

%E Corrected by _Robert Israel_, Jun 13 2018

%E a(17), a(19)-a(20) from _Robert Israel_, Jun 13 2018

%E a(16), a(18) from _Giovanni Resta_, Jun 14 2018