So I have this given problem,
$$ n*lg(n) = x $$
x is given in the problem, for example, 100.
How can I find n in this problem?
So I have this given problem,
$$ n*lg(n) = x $$
x is given in the problem, for example, 100.
How can I find n in this problem?
On
Using Lambert's $W$ function, solution is
$$ n = \frac{x}{W(x)} $$
Otherwise, a numerical solution can be also be found using a root finding algorithm, e.g. Newton's method, in the case $x = 100$ the result is
$$ n \approx 29.54 $$
On
For large $x$, start from the approximations
$$n\approx\frac x{\log_2x}$$ and $$n\approx2\frac x{\log_2x}.$$
Then refine by dichotomic search.
E.g. for $x=100$, the starting approximations are $15$ and $30$, such that $15\log_215=58.6$ and $30\log_230=147.2$. Then middle value, $22$, yields $22\log_222=98.1$.
As already said in answers, $$n\log_2(n)=x\implies n=\frac{x \log (2)}{W(x \log (2))}=\frac t {W(t)}$$ using $t=x\log(2)$.
If you cannot use Lambert function, you need a numerical method (Newton as the simplest) and you can generate the starting value $n_0$ which will be updated according to $$n_{k+1}=\frac{n_k+x \log (2)}{\log (n_k)+1}$$
If $x$ is large, you can use the truncated expansion $$W(t)=L_1-L_2+\frac{L_2}{L_1}\qquad \text{where}\qquad L_1=\log(t)\qquad L_2=\log(L_1)$$
Trying with $x=2^k$ $$\left( \begin{array}{ccc} k & n_0 & n \\ 2 & 2.71982 & 2.74537 \\ 3 & 3.72428 & 4.00000 \\ 4 & 5.85865 & 6.12128 \\ 5 & 9.50717 & 9.74309 \\ 6 & 15.7821 & 16.0000 \\ 7 & 26.7297 & 26.9384 \\ 8 & 46.0697 & 46.2749 \\ 9 & 80.6000 & 80.8036 \\ 10 & 142.818 & 143.016 \end{array} \right)$$