Message Boards Message Boards

0
|
3888 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Calculate (9^9)! and retrieve specific 5 digits from result?

Posted 5 years ago

Hi, to solve a puzzle I shall calculate the big number (9^9)!. Now I need to retrieve the 5 numbers at the digits 97550930-97550925 (to the right). Which term do I need to enter in WolframAlpha in oder to solve this and do I need to have another plan then the basic plan to do so? Thx for help.

POSTED BY: Veit Schmitt
3 Replies
Posted 5 years ago

Thx - I will check in 2 weeks - currently I am on vacation w/o my PC :-)

POSTED BY: Veit Schmitt

I think the answer is: {7, 9, 3, 7, 8, 7}

num=(9^9)!;                   (* compute the huge number: 3 billion digits *)
IntegerLength[num]-97550930     (* how many digits can we cut away on the right? *)
num2=Quotient[num,10^3000000000];    (* cut away 3 billion digits on the right*)
id=IntegerDigits[num2];     (* get the digits *)
Take[id,{97550925,97550930}]   (* get the digits, counting from the left *)
POSTED BY: Sander Huisman
Posted 5 years ago

Not an answer to your question, but worth checking if that range is in the number of trailing zeros in the factorial of the number. That is given by the sum of the floor of the number divided by each power of 5.

factorialTrailingZeros[n_] := NestWhileList[Floor[#/5] &, n, # > 0 &] // Rest // Total

factorialTrailingZeros[9^9]
(* 96855113 *)

That is smaller than the range 97550930 - 97550925, so they are not all zeros.

POSTED BY: Rohit Namjoshi
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