Find the number of consecutive zeroes at the end of the given number :- $1! \times 2! \times 3! \times 4! \times \dots \times 50!$

172 Views Asked by At

Number of zeroes will depend on the powers of $2$ and $5$ in the expression. Here it can be seen that total power of $5$ will be lesser than that of $2$.

From $5!$ to $24!$ I will get $1$ '$5$' each therefore $5^{20}$

at $25!$ there will be $5^{6}$

From $26!$ to $49!$ I will get $1$ '$5$' each therefore $5^{24}$

at $50 !$ there will be $5^{12}$

Hence total powers of $5$ comes out to be $5^{20+6+24+12}$ = $5^{62}$

Answer should be $62$ zeroes, but it is not matching with the official answer, Where am I going wrong in the process ?

2

There are 2 best solutions below

0
On BEST ANSWER

Each of $5!, 6!, 7!, 8!, 9!$ has exactly $1$ factor of $5$ for $5\times1$ factors of $5$.

Each of $10!, 11!, 12!, 13!, 14!$ has exactly $2$ factors of $5$ for $5\times2$ factors of $5$.

Each of $15!, 16!, 17!, 18!, 19!$ has exactly $3$ factors of $5$ for $5\times3$ factors of $5$.

Each of $20!, 21!, 22!, 23!, 24!$ has exactly $4$ factors of $5$ for $5\times4$ factors of $5$.

When we get to $25!$ we get an addition factor of 5 since $25=5^2$, therefore

Each of $25!, 26!, 27!, 28!, 29!$ has exactly $6$ factors of $5$ for $5\times6$ factors of $5$.

etc. down to

Each of $45!, 46!, 47!, 48!, 49!$ has exactly $10$ factors of $5$ for $5\times10$ factors of $5$.

Plus, $50!$ has exactly $12$ factors of $5$.

Thus the total number of factors of $5$ contained in the product $1!\times2!\times\cdots\times50!$ is

$$ 5(1+2+3+4)+5(6+7+8+9+10)+12=262$$

Am I missing any factors of 5?

If not, combine with 262 of the powers of 2 to get 262 zeros.

2
On

Shouldnt you count how often 10 divides $N:=1! \cdot \dots \cdot 50!$? So you need to know how often 5 divides it and how often 2 divides it and take the minimum of that.

Here is a straight forward way to count this -- no tricks involved! (There is probably a better way): Define a function $$ z:\mathbb N \to \mathbb N,\,n\mapsto (\text{number of consecutive zeros at the end of }n) $$ which is $z(n)=\max \{k\in\mathbb N\vert\, 10^k \text{ divides } n\}$ or equivalently $z(n)=\min\{\sigma_2(n),\sigma_5(n)\}$ where $\sigma_p$ is the exponent of the prime number $p$ in the prime factorization of $n$. Now notice that $\sigma_p$ is additive $$ \sigma_p(a\cdot b)=\sigma_p(a) + \sigma_p(b) $$ so that $\sigma_p(n!)=\sum_{k=1}^n\sigma_p(k)$ and hence for $N=1!\cdot \dots \cdot 50!$ we get $$ \sigma_p(N)=\sum_{j=1}^{50}\sum_{k=1}^j\sigma_p(k)=\sum_{j=1}^{50}(50-j+1)\sigma_p(j). $$ Thus we only need to know the values of $\sigma_2$ and $\sigma_5$ on $M_{50}=\{1,\dots,50\}$. The maximum of $\sigma_2$ is $5$ and the maximum of $\sigma_5$ is $2$.

Define sets $$ M_p^k=p^k\mathbb N\cap M_{50} $$ so that $M_p^k\supset M_p^{k+1}$ and $$ M_{50}=\bigcup_k M_p^k=\dot {\bigcup_k} M_p^k\backslash M_p^{k+1}. $$ (The dot denotes disjoint union) On these disjoint sets $\sigma_p$ is constant: We have that $\sigma_p=k$ on $M_p^k\backslash M_p^{k+1}$.

Lets use this for $p=5$: then $M_5^1=\{5,10,15,20,\dots,50\}$ and $M_5^2=\{25,50\}$ so that $$ \sigma_5(N)=2(50-25+1)+2(50-50+1) + \sum_{j=1,j\neq 5}^{9}(50-5j+1)\cdot 1=302. $$