I'm struggling with a math exercise here, and I would gladly appreciate some help.
My problem is that I've encoutered some very big numbers such as $3^{1000}$ and $2^{1000}$ and I want to estimate how many bits are needed to repesent these.
Thank you!
The binary representation of a positive integer $n$ has $\lfloor \log_2 n \rfloor + 1$ digits, i.e., requires that many bits to store; so, for example, the number $3^{1000}$ requires
$$\lfloor \log_2 (3^{1000})\rfloor + 1 = \lfloor 1000 \log_2 3 \rfloor + 1 = 1585$$
bits. Of course, if all of the numbers you're working with have the form $a^b$, it's considerably cheaper just to store the pair $(a, b)$; whether this is appropriate obviously depends on what you do with them.