View Single Post
 2013-11-29, 15:40 #1 jnml   Feb 2012 Prague, Czech Republ 101010112 Posts [Curiosity] Binary logarithm of a Mersenne number The binary logarithm[0] $L$ of a Mersenne number $M_n,\ n \in N$, having enough precision to reconstruct $M_n$ exactly after rounding $2^L$ to an integer, ie. $\left| M_n - 2^L \right|$ < ${1} \over {2}$ is $\ \ \ \ \ L = n - 2^{1-n}$. ---- The integral part of $L$ is $n-1$. The fractional part of $L$ consists of $n-1$ binary ones. For example: Code: n L L (base 2) ------------------------------- 1 0 0 2 1.5 1.1 3 2.75 10.11 4 3.875 11.111 5 4.9375 100.1111 ... [0]: http://en.wikipedia.org/wiki/Binary_logarithm