# Thread: n*2^n = 2^53 HOw to solve?

1. ## n*2^n = 2^53 HOw to solve?

n*2^n = 2^53

HOw to solve for n??

thank you

2. Originally Posted by tea217
n*2^n = 2^53

HOw to solve for n??

thank you
Formula iteration will solve this with a bit of cunning:

Rewrite the equation as:

n=ln[(2^55)/n]/log(2)

Then iterate:

n(r+1)=ln[(2^55)/n(r)]/log(2)

where n(r) is the r-th iterate.

Then with n(0)=1, we get:

n(1)=53,
n(2)=47.2721,
n(3)=47.4371,
n(4)=47.4321
n(5)=47.4322
n(6)=47.4322

With n=47.4322 the two sides of the original equation agree to 5 significant digits.

RonL

3. Originally Posted by tea217
n*2^n = 2^53

HOw to solve for n??

thank you
This can also be solved with the LamberW function.

If A=w*e^w, then W=LambertW(A).

n* e^(ln(2) n)=2^53,

or:

[ln(2)*n] e^[ln(2)*n]=ln(2)*2^53,

so:

ln(2)*n=LambertW(ln(2)*2^53),

or:

n=LambertW(ln(2)*2^53)/ln(2).

Now LambertW(ln(2)*2^53)~=32.8775, so n=32.8775/ln(2) ~=47.4322.

RonL

4. Originally Posted by CaptainBlack
Formula iteration will solve this with a bit of cunning:

Rewrite the equation as:

n=ln[(2^55)/n]/log(2)

Then iterate:

n(r+1)=ln[(2^55)/n(r)]/log(2)

where n(r) is the r-th iterate.

Then with n(0)=1, we get:

n(1)=53,
n(2)=47.2721,
n(3)=47.4371,
n(4)=47.4321
n(5)=47.4322
n(6)=47.4322

With n=47.4322 the two sides of the original equation agree to 5 significant digits.

RonL

"n=ln[(2^55)/n]/log(2)"

how did u get this statement?
why is there a ln and log? what base is log(2) ?

this method seems easier to understand than the other one, which i have never used that function before.

But i really appricate your help.

5. that lambert w function is incredible

6. Originally Posted by tea217
"n=ln[(2^55)/n]/log(2)"

how did u get this statement?
why is there a ln and log? what base is log(2) ?

this method seems easier to understand than the other one, which i have never used that function before.

But i really appricate your help.
Typo, default base for log is e, so when I forget to type ln and type log
I usually mean log base e.

We have:

n 2^n = 2^53

which we may rewrite as:

n e^(n ln(2))=2^53

so:

e^(n ln(2))=(2^53)/n

Now taking logs (ln's) gives:

n ln(2)= ln((2^53)/n)

n= ln((2^53)/n)/ln(2)

The equation is reorganised in this manner so that formula iteration
will converge (with the obvious rearrangement iteration diverges)

RonL