So I have a question where it says to find the last non zero digit of $20!$
I proceeded in the following way:
Found the prime factorization of $20!$ by calculation the greatest powers of $2,3,5,7,11,13,17,19$ in $20!$ using the following formula....for 2....as follows...
$$\left[\frac{20}{2}\right]+\left[\frac{20}{4}\right]+\left[\frac{20}{8}\right]+\left[\frac{20}{16}\right] = 18$$ and did the same for 3,5,7,9,11,13,17,19
This turned out to be $$20! = 2^{18}\times3^8\times5^4\times7^2\times11\times13\times17\times19$$
From here, multiplying in my head with just the unit digits gave me the answer that is, 4.
Is there any way to do it easier? I was able to do this as 20 is relatively small and it would have a max prime of 19, but what if, for example, the question was asked to find the last non zero digit in $77!$? Then this wouldn't be possible.
Any help would be appreciable