OFFSET
1,2
COMMENTS
Up to n=6600, a(n) = 0 for 867 values of n and a(n) >= n/2 for 4931 values of n.
When n+1 is a prime in A000043 and k=n, then 2^n+2^k-1 = 2^(n+1)-1 is a Mersenne Prime.
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..10000
MATHEMATICA
Table[k=n; While[k>0 && ! PrimeQ[2^n+2^k-1], k--]; k, {n, 100}] (* T. D. Noe, Jan 12 2011 *)
PROG
(PARI) A179291(n)={forstep(i=n, 1, -1, if(isprime(2^n+2^i-1), return(i))); return(0)} \\ Michael B. Porter, Jan 12 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jan 12 2011
STATUS
approved