Finding digits of a prime

• Oct 1st 2007, 03:53 PM
frankdent1
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.
• Oct 1st 2007, 04:11 PM
galactus
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.
• Oct 1st 2007, 05:04 PM
frankdent1
How does the log of the base times the exponent equal the number of digits for b^n -1 ?
• Oct 2nd 2007, 05:47 PM
frankdent1
bump
Ok, I understand there are 378632 digits, but why can we find the first few digits by using 10^.6151562...
• Oct 2nd 2007, 11:48 PM
CaptainBlack
Quote:

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 $\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