Message Boards Message Boards

0
|
4389 Views
|
6 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Function to view N-th digit of large number?

Posted 5 years ago

Hello, I would like to view numbers in the string on wanted position, eg. pi, e, 9^(9^9),...

I would like to see the digit on position 177486336 of the number 9^(9^9). I read a lot on internet but I thing I missed something.

Thank you for recommendation.

POSTED BY: SERGEJ KAREL
6 Replies
Posted 2 years ago

Hello. I need to find the last digit of number 9^9^9, i tried

IntegerLength[9^(9^9)]

a i get a number of digits, but i cannot use

ResourceFunction["NthDigit"][9^(9^9),369693100]

or

ResourceFunction["NthDigit"][9^(9^9),{369693100}]

It didnĀ“t work. Please help me, how can i do it?

POSTED BY: Jana Skoupa
Posted 2 years ago

There is no need to compute all the digits to determine the last one. Observe the pattern

Table[9^i, {i, 1, 10, 2}]
(* {9, 729, 59049, 4782969, 387420489} *)

Table[9^i, {i, 2, 10, 2}]
(* {81, 6561, 531441, 43046721, 3486784401} *)

Odd powers end in 9, even powers end in 1. Since 9^9 is odd, the last digit of 9^(9^9) must be 9.

Verify by computing the number

9^(9^9) // IntegerDigits // Last
(* 9 *)
POSTED BY: Rohit Namjoshi
Posted 5 years ago

Thank you.

POSTED BY: SERGEJ KAREL

I got these results:

a = 9^(9^9);
{FromDigits[Take[IntegerDigits[a], {177486336, 177486342}]]}
{FromDigits[Take[IntegerDigits[a], {352695442, 352695449}]]}

enter image description here

7 digits starting at the position 177486336: (* 3955388 *)

8 digits starting at the position 352695442: (* 11623480 *)

POSTED BY: Claudio Chaib

I don't know if this is the best way to do this, especially for big numbers, but my attempt gave this result:

a = 9^(9^9);
Take[IntegerDigits[a], {177486336}]

(* 3 *)

im1

If the precision of this command for large numbers is correct this should be the result...

Just for curiosity this is the amount of digits of this number:

IntegerLength[9^(9^9)]

(* 369693100 *)

POSTED BY: Claudio Chaib
Posted 5 years ago

This looks great. I tried but it gave me this: enter image description here

I know the length of this number and i would like to see

  • 7-digit sequence at position 177486336
  • 8-digit sequence at position 352695442
POSTED BY: SERGEJ KAREL
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract