login
A152162
Least k(n)>=floor(n/2) such that 3*2^k(n)*(2^n-1)-1 or 3*2^k(n)*(2^n-1)+1 is prime (or both primes)
1
0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 7, 6, 16, 9, 9, 8, 9, 10, 9, 10, 10, 14, 15, 13, 15, 15, 16, 15, 24, 17, 17, 21, 23, 17, 18, 45, 26, 25, 22, 23, 24, 21, 36, 25, 34, 23, 40, 35, 32, 42, 25, 26, 30, 32, 33, 31, 33, 32, 31, 30
OFFSET
1,4
COMMENTS
As n increases (sum k(n) for i=1 to n)/(sum n for i=1 to n) tends to log(2)
EXAMPLE
3*2^0*(2^1-1)-1=2 prime so k(1)=0 3*2^1*(2^2-1)-1=17 prime as 19 so k(2)=1 3*2^1*(2^3-1)-1=41 prime as 43 so k(2)=1
MATHEMATICA
lk[n_]:=Module[{k=Floor[n/2], c=3(2^n-1)}, While[NoneTrue[2^k*c+{1, -1}, PrimeQ], k++]; k]; Array[lk, 60] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Apr 01 2021 *)
CROSSREFS
Sequence in context: A060969 A367694 A358151 * A030699 A363959 A366387
KEYWORD
nonn
AUTHOR
Pierre CAMI, Nov 27 2008
STATUS
approved