login
Smallest prime either of the form prime(n)*2^k - 1 or prime(n)*2^k + 1, k >= 0, or 0 if no such prime exists, where prime(n) denotes the n-th prime number.
13

%I #21 Aug 03 2014 14:27:53

%S 3,2,11,13,23,53,67,37,47,59,61,73,83,173,751,107,1889,487,269,283,

%T 293,157,167,179,193,809,823,857,6977,227,509,263,547,277,1193,2417,

%U 313,653,2671,347,359,1447,383,773,787,397,421,1783,907,457,467,479,493567

%N Smallest prime either of the form prime(n)*2^k - 1 or prime(n)*2^k + 1, k >= 0, or 0 if no such prime exists, where prime(n) denotes the n-th prime number.

%C Primes arising from A194606 (or 0 if no such prime exists).

%H Arkadiusz Wesolowski, <a href="/A194608/b194608.txt">Table of n, a(n) for n = 1..1000</a>

%e For n=4, 7*2^0-1 and 7*2^0+1 are composite, but 7*2^1-1=13 is prime, so a(4)=13.

%t Table[p = Prime[n]; k = 0; While[! PrimeQ[a = p*2^k - 1] && ! PrimeQ[a = p*2^k + 1], k++]; a, {n, 100}] (* _Arkadiusz Wesolowski_, Sep 04 2011 *)

%Y Cf. A194591, A194600, A194603, A194606, A194607, A194635, A194636, A194637, A194638, A194639.

%Y Cf. A038699, A050921, A076335, A180247.

%K nonn

%O 1,1

%A _Arkadiusz Wesolowski_, Aug 30 2011