# The $25$th digit of $100!$

I want to find The $25$th digit of $100!$.

My attempt:It is easy to know it has $24$ zeroes.Because:

$\lfloor {\frac{100}{5}} \rfloor+\lfloor {\frac{100}{25}} \rfloor =24$

By getting the fist digits(after deleting all $5$ factors and $24$,$2$ factors)and multiplying them to each other we get the answer $4$ but I want an easier way.

• – lab bhattacharjee Jul 16 '16 at 8:58
• @labbhattacharjee The second one doesn't have any nice answer but the first one was helpful. – Taha Akbari Jul 16 '16 at 9:01

## 2 Answers

Observe the 24 zeros, divide them out, then

$$x \equiv \frac{4^{10} 9^{10} 20!}{5^4} \equiv 6^2 {4!}^4 \pmod{10}$$

Obviously $x \not \equiv \{5, 0\} \pmod {10}$, due to $5 \nmid x$. Similarly, it contains factor $2$, so it must be either $2, 4, 6, 8$. At this point, you can simple evaluate it, and you will get $4$.

• Answer is 3 ( 100! is 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000, calculator used www.careerbless.com/calculators/ScientificCalculator/ ) – Kiran Jul 16 '16 at 10:36
• Sorry for misinterpreting this. I thought it is from left. – Kiran Jul 16 '16 at 10:44
• @M.Fischer Can we find 25th digit from right ?, What if there were 10 zeroes then can we still find the 25 digit from right ? – A---B Jul 16 '16 at 17:21
• @ritwiksinha That's harder. The best way to do so would be to first find out the number of digits (i.e. reduce it to the form $x = 10^n c$ with $0.1 < c < 1$, and then find the $n - 25$ digit (divide $10^{n - 25}$ out under modulo 10) – AnonymousC Jul 17 '16 at 8:27
• Prime factor $100!$ by grouping the divisors together. Let $100! = \prod_{n=1}^100 n$, then you can simply "partition" it into smaller products, $(\prod_{n = 0, 5 \nmid 2n + 1}^{50} 2n + 1) (\prod_{n = 5, 5 | n}^{100} n)(\prod_{n = 1, 5 \nmid n, 2|n}^{100} n)$ (odd, even, products of fives, respectively). – AnonymousC Jul 24 '16 at 10:30

If we exclude the numbers that are divisible by 5, we see a cycle that repeats.

$4! = 24\\ 9!/6!\equiv 24 \mod 100$

$100! = \frac {100!}{5^{20} 20!} (5^{20} 20!) = \frac {100!}{5^{20} 20!}\frac {20!}{5^4 4!} (4!)(5^{24})$

$(24^{25})(5^{24}) = (12^{25})(10^{24})(2)$

$12^{25} \equiv 12^5 \mod 100\equiv 32 \mod 100$

The last $2$ non-zero digits of 100! are $64.$