login
A179291
Greatest k <= n such that 2^n+2^k-1 is prime, or 0 if no such k exists.
3
1, 2, 2, 4, 4, 6, 6, 7, 0, 8, 6, 12, 8, 12, 10, 16, 0, 18, 18, 18, 12, 10, 16, 21, 0, 15, 22, 22, 0, 30, 20, 24, 0, 32, 34, 21, 8, 3, 38, 36, 16, 26, 0, 43, 0, 43, 42, 43, 0, 48, 46, 38, 0, 28, 44, 55, 0, 54, 0, 60, 56, 28, 56, 60, 64, 63, 48, 60, 0
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.
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
KEYWORD
nonn
AUTHOR
Pierre CAMI, Jan 12 2011
STATUS
approved