(1) How many trailing zeros will be there after the rightmost non-zero digit in the value of 25! ?
(2) What is the remainder when 1044*1047*1050*1053 is divided by 33 ?
$\displaystyle 25 \times 24 \times 23 \times22 \times21 \times20 \times 19 \times 18 \times 17 \times 16 \times 15 \times 14 \times 13 \times 12 \times 11 \times 10 \times 9$ $\displaystyle \times 8 \times 7 \times 6 \times 5 \times 4 \times 3 \times 2$
Now let's start dividing this by 10 until we can't do it anymore, keeping a tally all the while!
So divide it by 10 and that gets rid of the 10! (1)
$\displaystyle 25 \times 24 \times 23 \times22 \times21 \times20 \times 19 \times 18 \times 17 \times 16 \times 15 \times 14 \times 13 \times 12 \times 11\times 9$ $\displaystyle \times 8 \times 7 \times 6 \times 5 \times 4 \times 3 \times 2$
Divide it by 2 and 5, is the same as divide by 10, so that will get rid of the 2 and the 5! (2)
$\displaystyle 25 \times 24 \times 23 \times22 \times21 \times20 \times 19 \times 18 \times 17 \times 16 \times 15 \times 14 \times 13 \times 12 \times 11\times 9$ $\displaystyle \times 8 \times 7 \times 6 \times 4 \times 3 $
Divide it by 2 and 5 again. Let the 5 divide the 25, and let the 2 divide the 24!(3)
$\displaystyle 5 \times 12 \times 23 \times22 \times21 \times20 \times 19 \times 18 \times 17 \times 16 \times 15 \times 14 \times 13 \times 12 \times 11\times 9$ $\displaystyle \times 8 \times 7 \times 6 \times 4 \times 3 $
Divide it by 2 and 5 again. Let the 2 divide the 12, and the 6 divide the 5! (4)
$\displaystyle 6 \times 23 \times22 \times21 \times20 \times 19 \times 18 \times 17 \times 16 \times 15 \times 14 \times 13 \times 12 \times 11\times 9$ $\displaystyle \times 8 \times 7 \times 6 \times 4 \times 3 $
Divide by 2 and 5 again. The 2 divides the 6, and the 5 divides the 20! (5)
$\displaystyle 3 \times 23 \times22 \times21 \times 4 \times 19 \times 18 \times 17 \times 16 \times 15 \times 14 \times 13 \times 12 \times 11\times 9$ $\displaystyle \times 8 \times 7 \times 6 \times 4 \times 3 $
Divide by 2 and 5 again, let the 2 divide the 22, and the 5 divide the 15. (6)
$\displaystyle 3 \times 23 \times 11 \times21 \times 4 \times 19 \times 18 \times 17 \times 16 \times 3 \times 14 \times 13 \times 12 \times 11\times 9$ $\displaystyle \times 8 \times 7 \times 6 \times 4 \times 3 $
Now there are no more multiples of 5 in there. And ALL multiples of 10 are also multiples of 5. So we are finished.
There are 6 zeros.
there is no need of this thing
Now let's start dividing this by 10 until we can't do it anymore, keeping a tally all the while!
So divide it by 10 and that gets rid of the 10! (1)
Divide it by 2 and 5, is the same as divide by 10, so that will get rid of the 2 and the 5! (2)
Divide it by 2 and 5 again. Let the 5 divide the 25, and let the 2 divide the 24!(3)
Divide it by 2 and 5 again. Let the 2 divide the 12, and the 6 divide the 5! (4)
Divide by 2 and 5 again. The 2 divides the 6, and the 5 divides the 20! (5)
Divide by 2 and 5 again, let the 2 divide the 22, and the 5 divide the 15. (6)
Now there are no more multiples of 5 in there. And ALL multiples of 10 are also multiples of 5. So we are finished.
There are 6 zeros.
there is a formula for this
and i m sorry i posted wrong answer, as i was in hurry at that time
Indeed there is. Although it's quite a complicated formula it can be reduced to a simple algorithm:
Take 25, and divide it by 5. You get 5.
Take 25 and divide it by 5^2. You get 1.
Take 25 and divide it by 5^3...
Take 25 and divide it by 5^4...
And the idea is that you keep doing this until you get a result that is less than 1! When you get to that result, take all the results you get beforehand and sum them. That is the number of trailing zeroes.
In our example 25/5^3 = 0.2, so we sum the results before that, 1 and 5. We get 6.
Note: If you ever get a result that is MORE than 1, but isn't an integer, you round down to the nearest integer. So it you get 4.2, you would round down to 4. If you get 4.9999999, you would round down to 4.
formula to find highest power of prime p dividing n!
[n/p]+[n/(p^2)]+[n/(p^3)]+[n/(p^4)]+[n/(p^5)]+.....
till [n\(p^m)]=0 for some m
[] ->greatest integer function
since 10 is not a prime number
so we factorize it and we get 2 and 5, since 2x5=10
so first put p=2
[25/2]+[25/4]+[25/8]+[25/16]+[25/32]+....
12+6+3+1+0(STOP)
=22
and then similarly put p=5
u get 6
this implies
2^22 and 5^6 are factors of 25!
this implies
(2^22)*(5^6)=(10^6)*(2^16)
therefore 10^6 is a factor of 25!
hence there are 6 zero's to the right of non-zero in 25!
Let $\displaystyle f(n) $ be the function that finds the number of trailing zeros of a factorial $\displaystyle n!$. Then :
$\displaystyle \displaystyle f(n) = \sum_{i = 1}^k \left \lfloor \frac{n}{5^i} \right \rfloor =
\left \lfloor \frac{n}{5} \right \rfloor + \left \lfloor \frac{n}{5^2} \right \rfloor + \left \lfloor \frac{n}{5^3} \right \rfloor + \cdots + \left \lfloor \frac{n}{5^k} \right \rfloor, \,$
You must choose $\displaystyle k $ such that $\displaystyle 5^{k+1} > n $.
$\displaystyle \displaystyle \left \lfloor \right \rfloor $ denotes the flooring function. The flooring function takes any real number m and rounds it to the nearest integer r such that $\displaystyle r \leq m $ i.e., it always rounds DOWN.
In our example, we want to find the trailing zeros in $\displaystyle 25! $. Hence $\displaystyle n = 25 $
The lowest integer $\displaystyle k $ such that $\displaystyle 5^{k+1} > n $ is 2. $\displaystyle 5^{2+1} = 5^3 = 125 > 25 $
Hence!
$\displaystyle \displaystyle f(25) = \sum_{i = 1}^2 \left \lfloor \frac{25}{5^i} \right \rfloor =
\left \lfloor \frac{25}{5} \right \rfloor + \left \lfloor \frac{25}{5^2} \right \rfloor$
$\displaystyle = \left \lfloor 5 \right \rfloor + \left \lfloor 1 \right \rfloor$
$\displaystyle = 5+1 = 6$
If $\displaystyle k$ is the largest natural number such that $\displaystyle 5^k|N!$ then there are $\displaystyle k$ trailing zeros on $\displaystyle N!$.
That is $\displaystyle k$ is the power of $\displaystyle 5$ in the prime decomposition of $\displaystyle N!$.
Now look at $\displaystyle 25!$, $\displaystyle 5$ is a factor of single multiplicity of $\displaystyle 5$, $\displaystyle 10$, $\displaystyle 15$ and $\displaystyle 20$ and of multiplicity $\displaystyle 2$ of $\displaystyle 25$. These multiplicities sum to $\displaystyle 6$ so there are $\displaystyle 6$ trailing zeros to $\displaystyle 25!$ (because there are enough even numbers to add a zero for every one of the factors of $\displaystyle 5$)
.