# Math Help - Finding digits of a prime

1. ## Finding digits of a prime

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.

2. To find the number of digits, use $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 $10^{.615156}=4.12217....$

The first 3 digits are 412.

3. How does the log of the base times the exponent equal the number of digits for b^n -1 ?

4. ## bump

Ok, I understand there are 378632 digits, but why can we find the first few digits by using 10^.6151562...

5. Originally Posted by frankdent1
Ok, I understand there are 378632 digits, but why can we find the first few digits by using 10^.6151562...
First the leading 3 digits of $2^{1257787}-1$ are the same as those of $2^{1257787}$, so we need only consider the latter.

Now: $2^{1257787}= 10^{\log_{10}(2)\times 1257787}\approx 10^{378631.615156}$.

Now the $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 $0.615156$ tells you what the digits are.

RonL