1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Computing end-digits of large factorials

  1. Oct 31, 2011 #1
    The factorial of 1 trillion ends in many trailing zeros. Find the five digits that comes before the trailing zeros.

    I know how to calculate the number of trailing zeros, but don't know what to do afterwards. This is a computational problem.
     
  2. jcsd
  3. Oct 31, 2011 #2

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    One trillion could be either 10^12 or 10^18, depending on where you reside. Which one do you mean? See http://en.wikipedia.org/wiki/Trillion .

    RGV
     
  4. Oct 31, 2011 #3
    10^12, sorry.

    Should it make a difference though?
     
  5. Oct 31, 2011 #4

    SammyS

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Gold Member

    It will make a huge difference. But, it may not make a difference in the final 5 non-zero digits.

    Do you know how many trailing zeros there are in (1012)! ?
     
    Last edited: Oct 31, 2011
  6. Nov 1, 2011 #5
    Let a = 10^12, b = n be largest n such that a/5^n is an integer.

    Number of trailing zeros will be N = a/5 + a/(5^2) + a/(5^3) + ... a/(5^n) = a/(5^n) * (1 + 5 + 5^2 + ... + 5^(n-1) ) = a/(5^n) * [ 5^n - 1] / [5 - 1].

    But (10^12)! / 10^N is still pretty damn large to calculate. I don't see the next step.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Computing end-digits of large factorials
  1. Sum with factorial (Replies: 9)

  2. Factorial Sequences (Replies: 12)

Loading...