Finding the Last Non-Zero Digit of a Repeated Factorial Expression

  • Thread starter MAXIM LI
  • Start date
  • Tags
    Factorial
  • #1
MAXIM LI
6
2
Homework Statement
$$(\dots((2018\underset{! \text{ occurs }1009\text{ times}}{\underbrace{!)!)!\dots)!}}$$?
Relevant Equations
$$(\dots((2018\underset{! \text{ occurs }1009\text{ times}}{\underbrace{!)!)!\dots)!}}$$?
Without using computer programs, can we find the last non-zero digit of $$(\dots((2018\underset{! \text{ occurs }1009\text{ times}}{\underbrace{!)!)!\dots)!}}$$?

What I know is that the last non-zero digit of ##2018!## is ##4##, but I do not know what to do with that ##4##.

Is it useful that ##!## occurs ##1009## times where ##1009## is half of ##2018##? If that is useful, then what if ##1009## was another value, say ##1234##?

Any help will be appreciated. THANKS!
 
  • Like
Likes docnet
Physics news on Phys.org
  • #2
MAXIM LI said:
What I know is that the last non-zero digit of ##2018!## is ##4##, but I do not know what to do with that ##4##.
How do you calculate that?
 

FAQ: Finding the Last Non-Zero Digit of a Repeated Factorial Expression

1. What is a repeated factorial expression?

A repeated factorial expression involves calculating the factorial of a number multiple times. For example, if we have a number n, we first calculate n!, then (n!)!, and so on. This process can be repeated multiple times depending on the problem's requirements.

2. Why is finding the last non-zero digit of a factorial expression challenging?

Finding the last non-zero digit of a factorial expression is challenging because factorials grow very quickly and contain many trailing zeros, especially as the number increases. These trailing zeros result from the multiplication of factors of 10 (which are products of 2 and 5). Removing these zeros and isolating the last non-zero digit requires careful handling of large numbers and their prime factorization.

3. What is the significance of trailing zeros in a factorial?

Trailing zeros in a factorial are significant because they indicate the presence of factors of 10 in the product sequence. Each trailing zero corresponds to a pair of factors 2 and 5. Since factorials include all integers up to a given number, the number of trailing zeros increases rapidly due to the frequent occurrence of these pairs, making it harder to find the last non-zero digit.

4. How can we efficiently find the last non-zero digit of a factorial?

To efficiently find the last non-zero digit of a factorial, we can use modular arithmetic to avoid directly computing the large factorials. By repeatedly removing factors of 10 (factors of 2 and 5) and keeping track of the remaining product modulo 10, we can determine the last non-zero digit. This approach leverages properties of number theory to simplify the computation.

5. Are there any algorithms or formulas specifically for finding the last non-zero digit of a factorial?

Yes, there are algorithms and formulas designed to find the last non-zero digit of a factorial. One common method involves calculating the factorial while ignoring factors of 10. This method uses modular arithmetic to keep track of the product modulo 10 and adjusts for the removal of factors of 2 and 5. Additionally, precomputed tables and properties of cyclic patterns in factorials can be used to simplify the process further.

Back
Top