login
Least k >= 0 such that prime(n)*2^k - 1 or prime(n)*2^k + 1 is prime, or -1 if no such value exists, where prime(n) denotes the n-th prime number.
13

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

%S 0,0,1,1,1,2,2,1,1,1,1,1,1,2,4,1,5,3,2,2,2,1,1,1,1,3,3,3,6,1,2,1,2,1,

%T 3,4,1,2,4,1,1,3,1,2,2,1,1,3,2,1,1,1,11,1,4,2,3,1,2,1,11,1,1,9,3,6,1,

%U 1,3,3,4,1,1,2,1,2,11,4,3,2,1,4,1,2,1,1

%N Least k >= 0 such that prime(n)*2^k - 1 or prime(n)*2^k + 1 is prime, or -1 if no such value exists, where prime(n) denotes the n-th prime number.

%C A194607 gives the record values.

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

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/BrierNumber.html">Brier Number</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)=1.

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

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

%Y Cf. A040081, A040076, A076335, A180247.

%K sign

%O 1,6

%A _Arkadiusz Wesolowski_, Aug 30 2011