I'd like to know how to find the first 3 digits and the number of digits of the prime number 2^1257787-1. I think I'm supposed to use logarithms.
To find the number of digits, use $\displaystyle 1257787log(2)=378631.615156$
There are 378632 digits in the number, not subtracting the 1.
For the first few digits of the huge number, use $\displaystyle 10^{.615156}=4.12217....$
The first 3 digits are 412.
First the leading 3 digits of $\displaystyle 2^{1257787}-1$ are the same as those of $\displaystyle 2^{1257787}$, so we need only consider the latter.
Now: $\displaystyle 2^{1257787}= 10^{\log_{10}(2)\times 1257787}\approx 10^{378631.615156}$.
Now the $\displaystyle 378631$ in the exponent above just tells you how far the decimal point in the answer is to the left of the most significant digit, and the fractional part $\displaystyle 0.615156$ tells you what the digits are.
RonL