First Non-zero Digit of 200!

Starting from the right, what is the first non-zero digit of 200 ! 200! ?


The answer is 2.

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.

18 solutions

Si Wei How
May 20, 2014

Let A A be the last non-zero units digit is. First, we will determine A A modulo 5. We know that there are 24 = 100 5 + 100 25 24 = \lfloor \frac {100}{5} \rfloor + \lfloor \frac {100}{25} \rfloor multiples of 5.

We multiply all the non-multiples of 5 first which is 1 × 2 × 3 × 4 × 6 × . . . × 99 = ( 1 × 2 × 3 × 4 ) 20 ( m o d 5 ) 1 \times 2 \times 3 \times 4 \times 6 \times ... \times 99 = (1 \times 2 \times 3 \times 4)^{20} \pmod{5} . Similarly, we can multiply all the multiples of 5 but not multiples of 25 and lastly multiples of 25. Finally, we must multiply by 1 2 24 \frac { 1}{2^{24} } to pair up with the multiples of 5. As such, the digit will be

A ( 1 × 2 × 3 × 4 ) 20 ( 1 × 2 × 3 × 4 ) 4 ( 1 × 2 × 3 × 4 ) 1 × 3 24 ( m o d 5 ) ( 1 × 2 × 3 × 4 ) 25 × 8 1 6 ( 1 ) 25 × 1 6 1 ( m o d 5 ) . A \equiv (1 \times 2 \times 3 \times 4)^{20} \cdot (1 \times 2 \times 3 \times 4) ^ 4 \cdot (1 \times 2 \times 3 \times 4)^1 \times 3^{24} \pmod{5} \\ \equiv (1 \times 2 \times 3 \times 4)^{25} \times 81^{6} \equiv (-1)^{25} \times 1^6 \equiv -1 \pmod{5}.

Since there are more multiples of 2 then there are 5, the last non-zero digit must be even. Hence, A = 4 A=4 .

This is the only correct solution received.

Most other attempts claimed (without justification) that the product of numbers from 10 k + 1 10k+1 to 10 ( k + 1 ) 10(k+1) have the same last non-zero digit as 9 ! 9! , which is 8. This is most certainly not true What is wrong with their logic?

Calvin Lin Staff - 7 years ago

Log in to reply

The logic is that every 9 digits, there is a 0 digit, which they think 'clears' the units column - which is of course true, but they forget that there is now the next column to think about!

Tom Benn - 6 years, 6 months ago
Prateek Khare
May 20, 2014

200 ! = 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20 200! = 1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20… . 200 …….200

= ( 1.2.3.4.5.6.7.8.9.10 ) ( 11.12.13.14.15.16.17.18.19.20 ) = (1.2.3.4.5.6.7.8.9.10) (11.12.13.14.15.16.17.18.19.20) … ( 191.192.193.194.195.196.197.198.199.200 ) ……… (191.192.193.194.195.196.197.198.199.200)

i.e we divided 200 ! 200! In groups of 10 each

We can write 200 ! = ( 5.10.15.20.25.30.35 190.195.200 ) 200! = (5.10.15.20.25.30.35 …… 190.195.200) ( 1.2.3.4.6.7.8.9 ) ( 11.12.13.14.16.17.18.19 ) (1.2.3.4.6.7.8.9) (11.12.13.14.16.17.18.19) …… ( 191.192.193.194.196.197.198.199 ) … (191.192.193.194.196.197.198.199)

= 5 40 ( 40 ! ) ( 1.2.3.4.6.7.8.9 ) ( 11.12.13.14.16.17.18.19 ) = 5^{40} (40!) (1.2.3.4.6.7.8.9) (11.12.13.14.16.17.18.19) . . . . . ( 191.192.193.194.196.197.198.199 ) ..... (191.192.193.194.196.197.198.199)

Notice that after pulling two 5`s from each group of 10 numbers we are left with 8 numbers in each group which can be written in generalized form as ( 10 a + 1 ) ( 10 a + 2 ) ( 10 a + 3 ) ( 10 a + 4 ) ( 10 a + 6 ) ( 10 a + 7 ) (10a+1) (10a+2) (10a+3) (10a+4) (10a+6) (10a+7) ( 10 a + 8 ) ( 10 a + 9 ) (10a+8) (10a+9)

As we did earlier ,We have pulled 2 2 2^2 from group of these 8 numbers .Thus we have total of 2 40 2^{40} outside By pulling 2 2 2^2 from each group of 8 numbers of this product ( 1.2.3.4.6.7.8.9 ) ( 11.12.13.14.16.17.18.19 ) . . . . . (1.2.3.4.6.7.8.9) (11.12.13.14.16.17.18.19) ..... ( 191.192.193.194.196.197.198.199 ) (191.192.193.194.196.197.198.199)

Thus in totality by combining 2 40 2^{40} and 5 40 5^{40} we have 2 40 2^{40} 5 40 5^{40} = 1 0 40 10^{40} i.e. we pull all zeros out of the given number then unit digit of remnant (remaining part) will be our answer.

In 1 set of 10 numbers the unit digit of remaining numbers after pulling zeros is 4.Clearly we have 20 such sets with us.Thus after pulling zeros we can say last non zero digit of 200 ! = 200! = Unit Digit after pulling zeros of ( 40 ! 4 20 ) (40! 4^{20})

Thus our question reduces from a big number to relatively small number 40 ! 40! Again we can reduce 40 ! 40! And following the same process we can write 40 ! 40! = Unit of digit after pulling zeros out of ( 8 ! 4 4 ) (8! 4^4)

Now we cannot apply same further as we are left with 8 ! 8! which only has single 5 in it. But 8 ! 8! Is a very small number and we can easily calculate its unit digit by writing its prime factorization We know 8 ! = 1.2.3.4.5.6.7.8 8! = 1.2.3.4.5.6.7.8

Maximum power of 2

= [ 8 2 ] + [ 8 2 2 ] + [ 8 2 3 ] + [ 8 2 4 ] . . . . . . . . . = 4 + 2 + 1 + 0 = 7 =[ \frac {8}{2}] + [ \frac {8}{2^2}] + [ \frac {8}{2^3}] + [ \frac {8}{2^4}] ......... =4+2+1+0 =7

Where [ ] represents integral part

Maximum power of 3

= [ 8 3 ] + [ 8 3 2 ] . . . . . . = 2 + 0 = 2 =[ \frac {8}{3}] + [ \frac {8}{3^2}] ...... =2+0 =2

Maximum power of 5 =1

Maximum power of 7 =1

Thus 8 ! = 2 7 . 3 2 . 5 1 . 7 1 8! = 2^7.3^2.5^1.7^1

After pulling zeros we can write it as 8 ! = 2 × 5 ( 2 6 . 3 2 . 7 1 ) 8! = 2 \times 5(2^6.3^2.7^1)

Thus unit digit of remnant (remaining part) will be our answer

Unit digit of 2 6 = 4 2^6 = 4

Unit digit of 3 2 = 9 3^2 = 9

Unit digit of 2 6 . 3 2 . 7 1 = 4.9.7 = 2 2^6.3^2.7^1 = 4.9.7 = 2

And unit digit of 4 4 = 6 4^4 = 6

Thus 40 ! 40! = Unit of digit after pulling zeros out of ( 8 ! 4 4 ) = 2 × 6 = 2 (8! 4^4) = 2 \times 6 = 2

This solution features a very nice reduction to smaller factorials.

Common mistakes included ignoring some factors. Since the correct answer (2) can be obtained using a computer pretty easily, it is very much possible to fool yourself, by getting the right answer in a wrong way.

Calvin Lin Staff - 7 years ago

Log in to reply

What is the correct solution? 2 or 4?

Abdullah Shahriar - 6 years, 5 months ago
Caleb Wagner
May 20, 2014

By expanding out 200 ! 200! and with some basic counting, we can first establish that the prime factorization of 200 ! 200! contains exactly 49 five's and greater than 49 two's. Therefore, 200 ! 200! is divisible by 2 49 5 49 = 1 0 49 2^{49}5^{49} = 10^{49} but not by 1 0 50 10^{50} (because then we would have an extra five).

This tells us that 200 ! 200! ends in exactly 49 consecutive zeros. So, the first non-zero digit will be at place 50 to the left of the decimal point. Call this digit x x . We calculate x x by making use of the fact that x = 200 ! 1 0 49 ( m o d 10 ) x = \frac{200!}{10^{49}} \pmod{10} . We first start with the 60 ! 60! part of 200 ! 200! By removing 49 factors of two and 12 factors of five from the expansion of 60 ! 60! , and reducing each term ( m o d 10 ) \pmod {10} we obtain:

(3)(3)(7)(9)(3)(3)(7)(3)(7)(9)(9)(3)(3)(3)(7)(7)(9)(3)(3)(7)(7)(9)(7)(9)(9)(3)(9)(3)(7)(3)(9)(3)(3)(4)(6)(7)(8)(9)(2) ( m o d 10 ) \pmod {10}

By multiplying out this product pair-by-pair and reducing (mod 10) as we go, we eventually get 2.

Now we consider the other numbers in the expansion of 200 ! 200! , for now ignoring multiples of 5. In each of the 14 groups 60-70, 70-80, ... , 190-200 we have:

( 1 ) ( 2 ) ( 3 ) ( 4 ) ( 6 ) ( 7 ) ( 8 ) ( 9 ) ( m o d 10 ) = 6 ( m o d 10 ) (1)(2)(3)(4)(6)(7)(8)(9) \pmod{10} = 6 \pmod{10}

Multiply all 14 of these together, we get 6 14 = 6 ( m o d 10 ) 6^{14} = 6 \pmod{10} .

Finally, we look at the leftover multiples of 5 with all their factors of 5 removed. In (mod 10) these are:

(3)(4)(3)(6)(7)(8)(9)(4)(1)(2)(3)(4)(1)(6)(7)(8)(9)(6)(1)(2)(3)(4)(7)(6)(7)(8)(9)(8)

Reducing this term-by-term, we get 6 ( m o d 10 ) 6\pmod{10} .

Putting all this together, we have:

x = 200 ! 1 0 49 ( m o d 10 ) = ( 2 ) ( 6 ) ( 6 ) ( m o d 10 ) = 2 x = \frac{200!}{10^{49}} \pmod{10} = (2)(6)(6) \pmod{10} = 2

And we are done.

Seems correct, though hardly generalizable to bigger numbers.

Calvin Lin Staff - 7 years ago

how u find the remainder of 200!/10^49 after deviding by 10.......

i reched to this step but could not able to find the remainder or last digit

Avinash Singh - 6 years, 4 months ago
Brad Morin
May 20, 2014

Note that the first 200 positive integers consist of : 100 multiples of 2 50 multiples of 4 25 multiples of 8 12 multiples of 16 6 multiples of 32 3 multiples of 64 1 multiple of 128 That makes 100+50+25+12+6+3+1 = 197 factors of 2 in 200!.

The first 200 positive integers consist of: 66 multiples of 3 22 multiples of 9 7 multiples of 27 2 multiples of 81 That makes 97 factors of 3 in 200!.

Continuing we can find the prime factorization: 2^197 3^97 5^49 7^32 etc.

Let us eliminate the trailing zeros in the result of 200!. Because we have 49 factors of 5 and more than 49 factors of 2, then we have exactly 49 factors of 10. Let us remove the all the 5 factors, 49 of them, and 49 of the 2 factors. That leaves us with a number with no trailing zeros. We just need to identify the ones digit of this new number. The prime factorization for this new number is: 2^148 3^40 7^32 11^19 13^15 17^11 19^10 23^8 29^6 31^6 37^5 41^4 43^4 47^4 53^3 59^3 61^3 67^2 71^2 73^2 79^2 83^2 89^2 97^2 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199

148 of these factors end in 2 137 of these factors end in 3 62 of these factors end in 7 28 of these factors end in 9 We don't bother to count factors ending in 1

2^148 = 6 mod 10, giving us a ones digit of 6. 3^137 = 3 mod 10, giving us a ones digit of 3. 7^62 = 9 mod 10, giving us a ones digit of 9. 9^28 = 1 mod 10, giving us a ones digit of 1.

6 3 9*1 = 2 mod 10, giving us a ones digit of 2 DONE

This is really brute force, something that cannot be reasonably extended to numbers larger than 200.

Calvin Lin Staff - 7 years ago

Let's prime factorize 200!. We can write 200! = 2^{197} * 3^{97} * 5^{49} 7^{32} * 11^{19} * 13^{16} * 17^{11} * 19^{10} * 23^{8} * 29^{6} * 31^{6} * 37^{5} * 41^{4} * 43^{4} * 47^{4} * 53^{3} * 59^{3} * 61^{3} * 67^{2} * 71^{2} * 73^{2} * 79^{2} * 83^{2} * 89^{2} * 97^{2} * 101^{1} --------------------------------- * 199^{1}. Now we have to find the number of zeroes. We have 2^{197} and 5^{49}. As 49 is minimum there can be no more than 49 zeroes. Now we subtract 3^{49} from 3^{197} and we are left with 3^{148} Now we subtract 3^{49} from 3^{97} and we are left with 3^{48} as there are 49 zeroes. Now we have to multiply the last digits of all these factors. Now we multiply all the last digits of these prime factors last digit of 2^{148} is 6. last digit of 3^{48} is1. And so on. thus we have 6 1 1 1 9 3 1 1 1 1 7 1 1 1 7 9 1 9 1 9 1 9 1 9 1 3 7 9 3 7 1 7 9 9 1 7 3 7 3 9 1 1 3 7*9 =2(last digit) Thus we have the answer 2.

A brute force solution at best. Seems more like computer-assisted, actually.

Calvin Lin Staff - 7 years ago
창현 김
May 20, 2014

(??????a) (????b)==ab(mod10) 200!'s last number=(1 2 3 4 6 7 8 9)^20 * 20! * (5 15 25 35 ... 195)'s last number =6 8 (5^23) (1 3 7 9)^2(mod10)'s last number=8 25's last number=2

"68(5^23)(1379)^2(mod10)'s last number=" Not sure where this comes from...

Calvin Lin Staff - 7 years ago
黎 李
May 20, 2014

The answer must be even mod(C(200,100),25)=mod(C(8,4),25)=20 mod(C(200,100),4)=0 Last two digits of C(200,100) is 20 mod(C(100,50),25)=mod(C(4,2),25)=6 Define last nonzero digit of n! as L(n) mod(L(200),5)=mod(L(100)^2 2,5)=mod(L(50)^4 2*1^2,5)=2(because mod(a^4,5)===1) Therefore the answer is 2

Very cryptic solution. Lucas theorem is definitely relevant, but I cannot understand how it was used... gave "missing steps"

Calvin Lin Staff - 7 years ago

First of all, let's find how many trailing zeros are there in 200 !,

200 ! = k. 1 0 m 10^m , with k,m is positive integer

m = \lfloor 200 5 \frac {200}{5} \rfloor + \lfloor 200 25 \frac {200}{25} \rfloor + \lfloor 200 125 \frac {200}{125} \rfloor = 40 +8 +1 = 49

So : k = 200 ! 1 0 49 \frac {200 !}{10^{49}}

So : k = 1.2.3.4.6.7.8.9.2.11.12.13........198.199.8

Now, we just find the unit digit of k;

The unit digit of k ==> k(mod 10)

so after calculation the unit digits of k is 2

"k = 1.2.3.4.6.7.8.9.2.11.12.13........198.199.8" not clear what is meant here

Calvin Lin Staff - 7 years ago
Suhail Sherif
May 20, 2014

To calculate 100! with all 10s removed, I first found out how many 10s there were. This was 24, since there were 24 5s and more 2s in the factorization of 100! Then I found out all the prime factors of 100!, removed 24 5s and 24 2s and multiplied the others, taking the modulo of 2 each time. This I did in python.

Calvin Lin Staff
May 13, 2014

The number of zeros at the right end of an integer is equal to the number of times that 10 divides the number, which is equal to the minimum of the number of times that 2 and 5 divide the number. Clearly, the number of times 2 2 divides 200 ! 200! is much greater than the number of times 5 5 divides 200 ! 200! , so we determine the number of times 5 5 divides 200 ! 200! .

There are 200 5 + 200 25 + 200 125 = 49 \left \lfloor \frac {200} {5} \right \rfloor + \left \lfloor \frac {200}{25} \right \rfloor + \left \lfloor \frac {200}{125} \right \rfloor = 49 powers of 5 in 200 ! 200! , so we seek the last digit of N = 200 ! 1 0 49 N = \frac {200!}{10^{49}} . We will split this up into terms that are multiples of 125, multiples of 25 but not 125, multiples of 5 but not 25, multiples of 2 but not 5, and multiples of neither 2 nor 5,

200 ! 1 0 49 = 125 5 3 25 50 75 100 150 175 200 5 14 ( 5 10 195 ) 5 32 ( 2 4 6 198 ) 2 49 ( 1 3 7 199 ) \frac {200!} {10^{49}} = \frac {125}{5^3} \frac {25 \cdot 50 \cdot 75 \cdot 100 \cdot 150 \cdot 175 \cdot 200} {5^{14}} \frac { (5 \cdot 10 \cdot \ldots \cdot 195 ) } {5^{32}} \frac { (2 \cdot 4 \cdot 6 \ldots \cdot 198 )} {2^{49}} (1 \cdot 3 \cdot 7 \ldots \cdot 199)

Working modulo 2, N N is clearly even. Working modulo 5, we have

N = 200 ! 1 0 49 ( 1 ) ( 144 ) ( 1 2 3 4 ) 8 ( 2 80 49 ( 1 2 3 4 ) 20 ) ( 1 2 3 4 ) 20 ( m o d 5 ) N =\frac {200!}{10^{49}} \equiv (1) ( 144 ) (1 \cdot 2 \cdot 3 \cdot 4)^8(2^{80-49} (1 \cdot 2 \cdot 3 \cdot 4)^{20}) ( 1 \cdot 2 \cdot 3 \cdot 4)^{20} \pmod{5}

Since 1 2 3 4 = 24 1 ( m o d 5 ) 1 \cdot 2 \cdot 3 \cdot 4 =24 \equiv -1 \pmod{5} and 2 4 1 ( m o d 5 ) 2^4 \equiv 1 \pmod{5} , it follows that N ( 1 ) ( 1 ) ( 1 ) 8 2 3 ( 1 ) 20 ( 1 ) 20 8 2 ( m o d 5 ) N \equiv (1) (-1) (-1)^8 2^3 (-1)^{20} (-1)^{20} \equiv -8 \equiv 2 \pmod{5} .

Since N 0 ( m o d 2 ) N \equiv 0 \pmod{2} and N 2 ( m o d 5 ) N \equiv 2 \pmod {5} , hence N 2 ( m o d 10 ) N \equiv 2 \pmod{10} . Thus the last non-zero digit of 200 ! 200! from the right is 2 2 .

Yong See Foo
May 20, 2014

Let the exponent of p p in the prime factorization of k k be v p ( k ) v_p(k) . v 5 ( 200 ! ) = i = 1 200 5 i = 49 v_5(200!) = \sum_{i=1} \lfloor \frac{200}{5^i} \rfloor=49 . Since v 5 ( 200 ! ) < v 2 ( 200 ! ) v_5(200!)<v_2(200!) , there are 49 zeros at the back of 200 ! 200! . 49 = v 2 ( 20 ) + 20 + 11 49=v_2(20)+20+11 . Therefore the answer is the last digit of 200 ! 1 0 49 \frac{200!}{10^{49}} which is ( 3 × 6 × 7 × 8 × 9 ) 20 × 2 11 × 4 9 2 20 × 8 × 4 2 ( m o d 10 ) (3 \times 6 \times 7 \times 8\times 9)^{20} \times 2^{11} \times 4^9 \equiv 2^{20} \times 8\times 4\equiv 2 \pmod{10} . The explanation of the equation is as follows: The 49 2's that have to be cancelled have v 2 ( 20 ) v_2(20) of them to be cancelled in the factors that are multiple of 10's cancelled. Another 20 of them have been cancelled in the factors with last digit 2. The remaining 11 cancel 11 factors that end with 4. Therefore the answer is 2.

There is a mistake here: when dividing numbers ending in 5, the quotient is not necessarily ending at 1 (which seems to be implicitly assumed).

Calvin Lin Staff - 7 years ago
Anoopam Mishra
May 20, 2014

100! = 1x2x3x4x5x...........x100 = (1x2x....x10)(11x12x...x20).....(91x92x....x100)

All terms in the bracket in the bracket when multiplied will get the same non-zero digit (from right). As each bracket has a number ending with 1,2,3,4,5,6,7,8,9,0.

We see that the first bracket is 10! which equals 3628800. So the first non-zero digit(from the right) is 8.

So the first non-zero digit(from the right) of all the brackets will be 8.

So we have to find the unit's digit of 8^10. We have the following series for the unit' digit of 8.

8^1 = 8, 8^2 = 4, 8^3 = 2, 8^4 = 6, 8^5 = 8, 8^6 = 4, 8^7 = 2, 8^8 = 6, 8^9 = 8, 8^10 = 4.

So the first non-zero digit(from the right) of 100! is 4.

Abhishek Prasad
May 20, 2014

we are infact looking out for singlr digit factorials. since last non zero digit of 9! is 8. to get to 100! we multiply 8 ten times. which would give us the last digit using cyclicity of 8 as 4.

Abhishek Prasad
May 20, 2014

if we find out the last digit of 10! which is 8 and since 20! can be said as multiplying 8*8 therefore 100! is 8^10 i,e 4.

Shen Hong
May 20, 2014

Except the zero, we have 11 numbers of 1, 10 numbers of 2,3, …,9 We get the unit digits of 1 to 9: 1,4,9,6,25,6,9,4,1 The last unit digit is 4.

Aqil Kamarudin
May 20, 2014

Working in modulo 10, and omitting zeroes, 100 ! = ( 1 × 2 × 3 × 4 × 5 × 6 × 7 × 8 × 9 ) 10 = 8 0 10 = 8 10 = 4 100! =(1 \times 2 \times 3 \times 4 \times 5 \times 6 \times 7 \times 8 \times 9)^{10}=80^{10}=8^{10}=4

Xuesong Du
May 20, 2014

the first non-zero digit from the right of 9! is 8, hence the first non-zero digit from the right of 100! is the last digit of 8^9, hence it is 4.

100 fact will have 24 zeroes we can get that by dividing it by 5..so 25 digit is non zero..1 2 3 ...9 we take this leave 5 and 2 so 3 4 6 7 8 9=unit digit will be 8 like this we have ten sets so 8 pow 10 = 4 (since cyclicity is 4)unit digit so ans is 4

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...