# How many zeros are there at $1000!$ in the base $24$

I know $1000!$ has $\frac{1000}{5}+\frac{1000}{25}+\frac{1000}{125}+\frac{1000}{625}=249$ terminal zeros in decimal notation, but what if we write $1000!$ in base $24$, how many terminal zeros would it have? Is there a way to compute it?

Regards

-
Is that $1000_{10}!$ or $1000_{24}!$? They are rather different. The approach is the same, however. – Ross Millikan Feb 19 '13 at 17:12

The power of $2$ in $1000!$ is

$$a=\left\lfloor \frac{1000}{2}\right\rfloor+\left\lfloor\frac{1000}{4}\right\rfloor+\left\lfloor\frac{1000}{8}\right\rfloor+\left\lfloor\frac{1000}{16}\right\rfloor+\left\lfloor\frac{1000}{32}\right\rfloor+\left\lfloor\frac{1000}{64}\right\rfloor+\left\lfloor\frac{1000}{128}\right\rfloor+\left\lfloor\frac{1000}{256}\right\rfloor+\left\lfloor \frac{1000}{512}\right\rfloor$$ The power of $3$ in $1000!$ is

$$b=\left\lfloor\frac{1000}{3}\right\rfloor+\left\lfloor\frac{1000}{9}\right\rfloor+\left\lfloor\frac{1000}{27}\right\rfloor+\left\lfloor\frac{1000}{81}\right\rfloor+\left\lfloor\frac{1000}{243}\right\rfloor+\left\lfloor\frac{1000}{729}\right\rfloor$$

Thus the number of zeroes is $\min \{ \lfloor \frac{a}{3} \rfloor, b \}$.

-
Should not it be min rather than max? – Xentius Feb 19 '13 at 5:34
I believe that each of those fractions should be floored. – robjohn Feb 19 '13 at 11:31
@robjohn Ty fixed... That was a bad mistake, especially since $1000$ is just a bit smaller than $1024$, which would make the floor of all fractions larger... – N. S. Feb 19 '13 at 16:43

For a prime $p$, the number of factors of $p$ in $n!$ is $$\frac{n-\sigma_p(n)}{p-1}$$ where $\sigma_p(n)$ is the sum of the base $p$ digits for $n$.

In base $2$, $1000_\text{ten}=1111101000_\text{two}$; thus, the number of factors of $2$ in $1000!$ is $\frac{1000-6}{2-1}=994$ which means $331$ factors of $8$.

In base $3$, $1000_\text{ten}=1101001_\text{three}$; thus, the number of factors of $3$ in $1000!$ is $\frac{1000-4}{3-1}=498$.

Thus, the number of factors of $24$ in $1000!$ is $331$.

-

Yes - it is the same concept; essentially, you want to write $1000! = 3^{x}\cdot 8^{y} \cdot \textrm{stuff}.$ Then take the minimum of $x$ and $y$ to get the number of zeros at the end.

-

You need to figure out how many times 24 divides 1000!. Since $24 = 2^3\cdot 3$, figure out how many times $2$ and $3$ divide 1000!. This can be done in exactly the same way you did it above: What you found was the number of times $5$ divided $1000!$.

-