# N factorial

1. Apr 27, 2005

### vagabond

Given that the 2005th digit in n! is zero, what is the possible value of n ?
Thanks

2. Apr 28, 2005

### shmoe

Are you counting digits from the right? ie. the 3rd digit of 1234567 would be 5? Are you looking for the least n where the 2005th digit of n! is 0?

Can you work out the highest power of 5 that divides n!? The highest power of 2? (the 2's won't really be an issue though)

3. May 5, 2005

### vagabond

Yes.

I would like to find all n where the 2005th digit of n! is 0.
Can we deduce if the possible number of such n is finite? Can we find the pattern?

If n is known, I can do it.
For instance, if n=100, then in n!, the factors 5, 10, 15, 20, ..., 95, 100 involve 5.
So the highest power of 5 that divides n! is 1+1+1+1+2+1+1+1+1+2+1+1+1+1+2+1+1+1+1+2 = 24.
But if n is unknown, I do not know how to do.

Also, this method is used to count the number of '0' appeared in n!.
But how do we know the location of the '0' is at 2005th position or not?

4. May 5, 2005

### Data

This is easy. No, there are an infinite number of integers n such that the 2005th (from the right) digit of n! is 0, since letting m be the first integer such that $10^{2005}|m!$ we find that the 2005th digit of m! is 0 and so is the 2005th digit of n! for every $\mathbb{Z} \ni n > m$.

This is not so easy. What we can do is work out the m that I mentioned above (so that every n>m has the desired property also). This is equivalent to finding the first $m$ s.t. $5^{2005}|m!$ (since there are clearly more factors of 2 than there are of 5 in m!), so let's see what we can do. I claim that the number of factors of 5 in m! for any positive integer m is

$$\sum_{n=1}^{\infty} \biggr \lfloor \frac{m}{5^n} \biggr \rfloor.$$

Now, before you use this, you should definitely prove it on your own (I haven't written out a rigorous proof - so maybe I'm wrong! You shouldn't risk it!).

Once you show that the statement above is true, you're almost done - you just have to solve for the first $m$ such that

$$\sum_{n=1}^{\infty} \biggr \lfloor \frac{m}{5^n} \biggr \rfloor \geq 2005.$$

Last edited: May 5, 2005
5. May 5, 2005

### saltydog

Here's the set between 800! and 1000! that have the 2005'th digit equal to 0:

{810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824,
825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839,
840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854,
855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869,
870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884,
886, 905, 922, 934, 948, 955, 965, 969, 985, 986, 992}

6. May 5, 2005

### shmoe

The digits are being counted from the right, not the left.

7. May 6, 2005

### abia ubong

i guess it should be 2008.i mean n should be 2008.just a guess you might give it a try

8. May 6, 2005

### saltydog

Ok, thanks. These then:

{811, 821, 828, 846, 850, 867, 872, 878, 880, 893, 896, 924, 925, 926, 932,
937, 938, 944, 978, 985}