login
a(n) = smallest prime of the form 2^k + 2n - 1, k = 0, 1, ..., or 0 if there is none.
2

%I #22 Jan 15 2017 07:43:20

%S 3,5,7,11,11,13,17,17,19,23,23,31,29,29,31,47,37,37,41,41,43,47,47,79,

%T 53,53,61,59,59,61,317,67,67,71,71,73,89,79,79,83,83,211,89,89,97,107,

%U 97,97,101,101,103,107,107,109,113,113,241,131,149,127,137,127,127,131

%N a(n) = smallest prime of the form 2^k + 2n - 1, k = 0, 1, ..., or 0 if there is none.

%C If n == 0 (mod 3) then the exponent k must be odd, if n>1 and n == 1 (mod 3) then k must be even and if n == 2 (mod 3) then k can be either.

%C Records: 3, 5, 7, 11, 13, 17, 19, 23, 31, 47, 79, 317, 1163, 1048847, 536871199, 2^955 + 773, ..., . - _Robert G. Wilson v_

%F a(n) = 2^A067760(n-1) + 2n-1 if A067760(n-1) > 0, 0 if A067760(n-1) = 0. - _Robert Israel_, Jan 14 2017

%e For n = 4, p = 2 -> 2^2+(2*4-1) = 11, the fourth entry because 2^1+(2*4-1) which equals 9 is not a prime.

%t f[n_] := Block[{p = 1}, While[ !PrimeQ[2^p + 2n - 1], p++ ]; 2^p + 2n - 1]; Array[f, 64] (* _Robert G. Wilson v_ *)

%o (PARI) g2(n) = forstep(k=1,n,2,for(p=1,n,y=k+2^p;if(isprime(y),print1(y",");break)))

%Y Cf. A067760.

%K nonn

%O 1,1

%A _Cino Hilliard_, Oct 08 2006

%E Edited and extended by _Robert G. Wilson v_, Nov 11 2006

%E Name edited by _Robert Israel_, Jan 14 2017