• jaybone@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    10 months ago

    Thanks! I’m still surprised at the number of trailing zeros though. Is that a function of how many multiples of ten there are in the factorial?

    • Natanael@slrpnk.net
      link
      fedilink
      arrow-up
      3
      ·
      10 months ago

      Just looked it up

      https://www.purplemath.com/modules/factzero.htm

      If we take the factorial of any number larger than 5, then there will be at least one zero at the end of the number. Why? Because 5! = 1×2×3×4×5; in particular, 5! = (2×5)×(1×3×4), and (2×5) = 10. The factorial of any larger number will have more copies of 2 and 5 (as factors of larger values, like 6 and 15), so there will be even more factors of 10 in these factorials. And every factor of 10 adds a zero to the end of the factorial expansion.