$N=1!+2\cdot 2!+3\cdot 3!+...+2017\cdot 2017!$ How many consecutive $9$ are there at the end of this number?

113 Views Asked by At

$N=1!+2\cdot 2!+3\cdot 3!+...+2017\cdot 2017!$ How many consecutive $9$ are there at the end of $N$?

I can't even understand why will there be nines at the end. I think maybe N can be represented as $X\cdot10^n-1$. Appreciate for any hint or clue. I will try to work it out.

2

There are 2 best solutions below

0
On BEST ANSWER

We can transform the series into a telescoping sum.

Using the fact that: $k\cdot k!=(k+1)!-k!$

$1+2\cdot 2! +3\cdot 3! +...+2017\cdot 2017! = 2018!-1!$

Now we need to find the number of trailing 0s in 2018! This is the same as finding the largest value of $k$ such that $10^k|2018!$.

$10=2\cdot 5$

$2^{10}=1024$ and $5^4=625$ 2s dominate 5s, so in order to find number of pairs of $(2,5)$ we need to count number of 5s

$k=\lfloor(2018/5) \rfloor +\lfloor(2018/25) \rfloor +\lfloor (2018/125)\rfloor+\lfloor(2018/625)\rfloor=403+80+16+3$

$k=502$

0
On

Here's what I got after the hint. Since k*k!=(k+1)!-k!, N=(2!-1!)+(3!-2!)+(4!-3!)...(2018!-2017!)=2018!-1. For 2018! , there must be more 2 factors than 5, so I only need to calculate 5. 2018/5=403...3 2018/25=80...18 2018/125=16...18 2018/625=3...143 So there are 403+80+16+3=502 zeros at the end.So there are 502 nines at the end.