Find: Number of n's such that n! is a multiple of 2^20 and not a multiple of 3^20.
Approach: Find the min and max values of n. Min value is the smallest n such that n! is a multiple of 2^20. Once we find that, we need to find how high that n can go. It can go up to the first multiple of 3^20. So we need to find the smallest n such that n! is a multiple of 3^20 and subtract 1.
min nFirst I tried n=20. How many 2s are there in 20!
\(\frac{20}{2}+\frac{20}{4}+\frac{20}{8}+\frac{20}{16}=10+5+2+1=18\)
So 20! is a multiple of 2^18, not 2^20. We need to keep looking.
Note that if n=22, then that will only increase the first term by 1, i.e. \(\frac{20}{2}\)-->\(\frac{22}{2}\). There will be no impact on the other terms. Thus 22! is a multiple of 2^19. Thus, the lowest n such that n! is a multiple of 2^20 is 24.
max nFirst I tried n=40. How many 3s are there in 40!
\(\frac{40}{3}+\frac{40}{9}+\frac{40}{27}=13+4+1=18\)
So 40! is a multiple of 3^18, not 3^20. We need to keep looking.
Note that if n=42, then that will only increase the first term by 1, i.e. \(\frac{40}{3}\)-->\(\frac{42}{3}\). There will be no impact on the other terms. Thus 42! is a multiple of 3^19. Thus, the lowest n such that n! is a multiple of 3^20 is 45. So max value of n such that n! is not a multiple of 3^20 is 44.
n! ranges from 24! to 44! inclusive --> 21 possible values of n.
Answer: B