# Finding digits of a prime

• Oct 1st 2007, 04: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, 05:11 PM
galactus
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.
• Oct 1st 2007, 06: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, 06: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 3rd 2007, 12:48 AM
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 $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