Is there a way to find the first digits of a number?

For example, the largest known prime is $2^{43,112,609}-1$, and I did sometime before a induction to find the first digit of a prime like that. But, is there a way to find the first digits of a number?

To find the last x digits is easy, just calculate it mod $10^x$, but we can do something about the first ones?

  • $\begingroup$ Out of curiosity, why would you want to know the first digit? $\endgroup$ – JavaMan Dec 7 '11 at 22:45
  • 7
    $\begingroup$ It's the middle ones that are difficult. $\endgroup$ – Ross Millikan Dec 7 '11 at 23:02
  • $\begingroup$ @JavaMan, well, is just curiosity too, but I think it can be applied to study some numbers ^^. $\endgroup$ – GarouDan Dec 7 '11 at 23:05
  • $\begingroup$ @RossMillikan, I think you're right. $\endgroup$ – GarouDan Dec 7 '11 at 23:05

What you want is $10$ to the power the fractional part of $43,112,609 \log_{10}2\approx 0.50033$, then $10^.50033\approx 3.1646$ so the leading digits are $316.$ Wolfram Alphaconfirms $31647$

  • $\begingroup$ Thx Ross, this works. Unfortunally André had deleted his answer. Thx André too. $\endgroup$ – GarouDan Dec 7 '11 at 23:22
  • 2
    $\begingroup$ You just need to be careful and make sure that the rounding errors involved are not too much. Getting the first digit of pi raised to the 10^18th power would be hard. $\endgroup$ – gnasher729 Sep 22 '14 at 12:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.