# of Numbers in Factorials II

Loading...

But what if we're not dividing by a prime number?

Part 1

For example, what if the question asks us to find the powers of $15$ in $200!$?

$$\frac{200!}{15^x}$$

We cannot simply use the trick we learned previously because $15$ is not a prime number. Thus, we need to rewrite the problem like so:

$$\frac{200!}{(3 \times 5)^x} = \frac{200!}{3^x5^x}$$

So now we're dealing with prime numbers. But the question is do we focus on the $3$ or the $5$? Well, to make one $15$, we need one $3$ and one $5$. Which is more common? In $200!$, are we going to find more powers of $3$ or more powers of $5$? We're going to find more powers of $3$. That means that...

$5 = $ limiting factor

So really this problem is asking us to focus solely on the powers of $5$ given that they are fewer in number than the powers of $3$. To find the number of powers of $15$ in $200!$, we simply find the number of powers of $5$ in $200!$.

$$\frac{200}{5^x}$$

Continuously divide by $5$ and take the whole number result 

$$40...8...1...0$$

$$40+8+1=49$$

Part 2

For example, what if the question asks us to find the powers of $4$ in $200!$?

$$\frac{200!}{4^x}$$

Now, you might be tempted to follow the process you've learned earlier ...

  • There are $50$ 4s in $200$
  • There are $12$ 16s in $200$
  • There are $3$ 64s in $200$

... and conclude that the maximum integer value of $x$ such that $4^x$ divides $200!$ is $63$. 

The problem is that we're off. Quite a bit off actually. The reason is that this method does not work when we're working with non-prime numbers. The good news is that we can easily reduce this problem into primes:

$$\frac{200!}{4^x} \rightarrow \frac{200!}{2^{2x}}$$

Why does this help? Because $2$ is a prime, we can use our existing method for finding powers in $n!$:

  • There are $100$ 2s in $200$
  • There are $50$ 4s in $200$
  • There are $25$ 8s in $200$
  • There are $12$ 16s in $200$
  • There are $6$ 32s in $200$
  • There are $3$ 64s in $200$
  • There is $1$ 128s in $200$

This gives us a total of $197$ powers of 2 in $200!$. But we're looking for powers of 4, not 2. Given that $4^x = 2^{2x}$, and $2^{197}$ divides $200!$, we just need to divide by $2$ (and take the integer part) to answer the problem: $2^{197} = 4^{197/2} = 4^{98}$ (not $98.5$ as $x$ needs to be an integer). Hence the largest integer value of $x$ is $98$.