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)
LINKS
Pierre CAMI, Table of n, a(n) for n = 1..2000
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
KEYWORD
nonn
AUTHOR
Pierre CAMI, Nov 27 2008
STATUS
approved