It is a common exercise to determine the number of trailing zeros of a factorial. For example, has 4 trailing zeros (as highlighted in green above).
However, finding the rightmost non-zero digit of a factorial is much harder. For example, the rightmost non-zero digit of is 4, as shown above.
Problem: Find the rightmost non-zero digit of .