

A179291


Greatest k <= n such that 2^n+2^k1 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
(list;
graph;
refs;
listen;
history;
text;
internal format)



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^k1 = 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^k1], k]; k, {n, 100}] (* T. D. Noe, Jan 12 2011 *)


PROG

(PARI) A179291(n)={forstep(i=n, 1, 1, if(isprime(2^n+2^i1), return(i))); return(0)} \\ Michael B. Porter, Jan 12 2011


CROSSREFS

Cf. A106821, A178993, A179013, A179760, A181498, A181514, A181408, A181409.
Sequence in context: A124195 A220662 A079584 * A004079 A096494 A116568
Adjacent sequences: A179288 A179289 A179290 * A179292 A179293 A179294


KEYWORD

nonn


AUTHOR

Pierre CAMI, Jan 12 2011


STATUS

approved



