Hello, everyone!
In case, you didn't understand the technique I used . . .
Note: \(\displaystyle [x]\) is the "greatest integer function".
How many factors-of-3 are contained in 37-factorial?
We know that: .\(\displaystyle 37! \;=\;1\cdot2\cdot3\cdot4\cdots 37 \)
We know that every third number has a factor of 3.
. . There are: .\(\displaystyle \left[\frac{37}{3}\right] \:=\: 12\) factors-of-3.
But every ninth number has \(\displaystyle 3^2\),
. . each of which contributes another factor-of-3.
There are: .\(\displaystyle \left[\frac{37}{9}\right] \:=\: 4\) more factors-of-3.
And every twenty-seventh number has \(\displaystyle 3^3\),
. . each of which contribute yet another factor-of-3.
There is: .\(\displaystyle \left[\frac{37}{27}\right] \:=\:1\) more factor-of-3.
Therefore, \(\displaystyle 37!\) contains: .\(\displaystyle 12 + 4 + 1 \:=\:17\) factors-of-3.