Solving $2^n - 2\times n = a $, where $a$ is a known constant

49 Views Asked by At

Solving $2^n - 2\times n = a $, where $a$ is a known constant.

This is my first question. I am having trouble solving the equation in the title...moreover I do not even know the name of that kind of equations. Any help would be veeeery appreciated.

2

There are 2 best solutions below

2
On BEST ANSWER

\begin{align} 2^n-2n=a &\iff e^{\ln{(2)}n}=2n+a\\ &\iff 1=(2n+a)e^{-\ln{(2)}n}\\ &\iff -\frac{\ln{(2)}}2=\left(-\ln{(2)}n-\frac{\ln{(2)}a}2\right)e^{-\ln{(2)}n}\\ &\iff -\frac{\ln{(2)}}2e^{-\ln{(2)}a/2}=\left(-\ln{(2)}n-\frac{\ln{(2)}a}2\right)e^{-\ln{(2)}n-\ln{(2)}a/2}\\ &\iff W_k\left(-\frac{\ln{(2)}}2e^{-\ln{(2)}a/2}\right)=-\ln{(2)}n-\frac{\ln{(2)}a}2\\ &\iff n=-\frac{a}2-\frac1{\ln{(2)}}W_k\left(-\frac{\ln{(2)}}2e^{-\ln{(2)}a/2}\right)\\ &\iff n=-\frac{a}2-\frac1{\ln{(2)}}W_k\left(-\frac{\ln{(2)}}{2^{a/2+1}}\right)\\ \end{align} Here $W_k(z)$ denotes the $k$th branch of the Lambert-W function.

1
On

If $n$ is a natural, we have the following sequence for $a$:

$$0,0,2,8,22,52,114,240,490,1004,\cdots$$

For higher $a$,

$$m=\lceil\log_2a\rceil$$ will give you a candidate solution and you can test

$$2^m-2m=a.$$