<p>Recommended Supplementary Video: <a href="https://vimeo.com/972350925/70aff29645">Shortcut for Large Factorials</a></p>
<p><a href="https://www.prepswift.com/quizzes/quiz/prepswift-of-numbers-in-factorials" target="_blank"># of Numbers in Factorials Exercise</a></p>
<p><a href="https://greg-mat.github.io/Factorial-Composite-NonFactors-Visualizer/">Factorial visualisation tool</a></p><p><strong><span style="color:#e74c3c;">WARNING</span>: </strong>The trick below only works if you're dividing by a prime number power.</p>
<p>To find the maximum <strong><span style="color:#27ae60;"># of Numbers in a Factorial</span></strong>, best to look at an example.</p>
<p>$$\frac{100!}{3^x}=integer$$</p>
<p>This question is saying that $100!$ is divisible by $3^x$. So what would be the maximum value of $x$? In other words, how many powers of $3$ are there in $100!$?</p>
<p><strong><span style="color:#e74c3c;"><span style="font-size:18px;">Here's the Trick</span></span></strong></p>
<ul>
<li><span style="color:#8e44ad;">Step 1</span>: How many multiples of $3^1$ are there from $1$ to $100$? <strong><span style="color:#27ae60;">$33$</span></strong></li>
<li><span style="color:#8e44ad;">Step 2</span>: How many multiples of $3^2$ ($9$) are there from $1$ to $100$? <strong><span style="color:#27ae60;">$11$</span></strong></li>
<li><span style="color:#8e44ad;">Step 3</span>: How many multiples of $3^3$ ($27$) are there from $1$ to $100$? <strong><span style="color:#27ae60;">$3$</span></strong></li>
<li><span style="color:#8e44ad;">Step 4</span>: How many multiples of $3^4$ ($81$) are there from $1$ to $100$? <strong><span style="color:#27ae60;">$1$</span></strong></li>
<li><span style="color:#8e44ad;">Step 5</span>: How many multiples of $3^5$ ($243$) are there from $1$ to $100$? <strong><span style="color:#e74c3c;">$0$</span></strong>
<ul>
<li>Once we hit <span style="color:#e74c3c;">$0$</span>, we stop.</li>
</ul>
</li>
</ul>
<p>Simply add those numbers together to find the number of powers of $3$ in $100!$:</p>
<p><span style="color:#27ae60;">$$33 + 11 + 3 + 1 = 48$$</span></p>
<p><strong><span style="color:#e74c3c;"><span style="font-size:18px;">An Even Faster Way</span></span></strong></p>
<p>Once you find the number of multiples of $3^1$ from $1$ to $100$, continue dividing that result by $3$ and taking the whole number result until you get to zero.</p>
<p style="text-align: center;"><span style="color:#e74c3c;"><em>Continuously divide by $3$ and take the whole number result </em></span></p>
<p>$$33...11...3...1...0$$</p>
<p style="text-align: center;"><span style="color:#27ae60;">$$33+11+3+1=48$$</span></p>
<p>Here's another example. How many powers of $5$ are there in $2000!$?</p>
<p style="text-align: center;"><span style="color:#e74c3c;"><em>Continuously divide by $5$ and take the whole number result </em></span></p>
<p>$$400...80...16...3...0$$</p>
<p style="text-align: center;"><span style="color:#27ae60;">$$400+80+16+3=499$$</span></p>