Find natural number such that has exactly trailing zeros.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
It's called p-adic valuation of a natural number n , with p prime, the maximum k such that p k divides n : v p ( n ) = m a x { k ∈ N : p k ∣ n }
Two theorems are useful in this problem: product theorem and Legendre-de Polignac's formula .
Product theorem states that v p ( m ⋅ n ) = v p ( m ) + v p ( n )
Legendre-de Polignac's formula states that v_p(n!)= \sum_{i=1}^{\infty} \Big{\lfloor} \frac{n}{p^i} \Big{\rfloor}
Their proofs aren't particularly difficult; you can try yourself to find them out if you want.
( 1 ! ⋅ 2 ! ⋅ . . . ⋅ n ! is called superfactorial and sometimes represented as n $ , so I will do the same here.)
Now, the number of trailing zeros of n $ is obviously equal to v 5 ( n $ ) . For product theorem and Legendre-de Polignac formula:
v_5(n\$)=v_5(1! \cdot 2! \cdot ... \cdot n!)=v_5(1!)+v_5(2!)+...+v_5(n!)=\displaystyle \sum_{i=1}^{\infty} \Big{\lfloor} \frac{1}{5^i} \Big{\rfloor}+ \displaystyle \sum_{i=1}^{\infty} \Big{\lfloor} \frac{2}{5^i} \Big{\rfloor}+...+\displaystyle \sum_{i=1}^{\infty} \Big{\lfloor} \frac{n}{5^i} \Big{\rfloor}\;\;\;\;\;[A]
We notice also that v 5 ( n ! ) = v 5 ( m ! ) if and only if ∃ k ∈ N : 5 k ≤ n , m < 5 ( k + 1 ) [ B ] .
Now, the problem asks when v 5 ( n $ ) = n . If n = 1 we have v 5 ( 1 $ ) = 0 , so n > v 5 ( n $ ) , but, for, let's say, n = 1 5 we have n < v 5 ( n $ ) , since v 5 ( 1 5 $ ) = 1 8 , so, if n = v 5 ( n $ ) , it would happen before 1 5 . This calculation are very easy to do, since [ A ] and [ B ] help us a lot. In fact, with very few attempts we find that v 5 ( 1 3 $ ) = 1 3 so n = 1 3 .