Mod1000 won't help!

Starting from the right of its decimal representation, find the sum of the first three non-zero digits of 600 ! 600! .

Details and Assumptions

  • The number is six hundred factorial.

  • As an explicit example, first three non-zero digits of 102225654000000 102225654000000 are 654 654 and their sum is 15 15 .


The answer is 19.

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.

2 solutions

Mas Mus
Aug 3, 2015

Let us write 600 ! 600! on format like below:

600 ! = ( 5 × 10 × 15 × 20 × 595 × 600 ) × ( 1 × 2 × 3 × 4 ) × ( 6 × 7 × 8 × 9 ) × × ( 596 × 597 × 598 × 599 ) = ( 5 120 × 120 ! ) × ( 1 × 2 × 3 × 4 ) × ( 6 × 7 × 8 × 9 ) × × ( 596 × 597 × 598 × 599 ) = ( 10 120 × 120 ! ) × 2 120 × ( 1 × 2 × 3 × 4 ) × ( 6 × 7 × 8 × 9 ) × × ( 596 × 597 × 598 × 599 ) 600!\\=\color{#D61F06}{\left(5\times{10}\times{15}\times{20}\ldots\times{595}\times{600}\right)}\times\\{\left(1\times{2}\times{3}\times{4}\right)}\times{\left(6\times{7}\times{8}\times{9}\right)}\times{\ldots\times{\left(596\times{597}\times{598}\times{599}\right)}}\\=\color{#D61F06}{\left({5}^{120}\times{120!}\right)}\times\\{\left(1\times{2}\times{3}\times{4}\right)}\times{\left(6\times{7}\times{8}\times{9}\right)}\times{\ldots\times{\left(596\times{597}\times{598}\times{599}\right)}}\\=\color{#D61F06}{\left({10}^{120}\times{120!}\right)}\times{2^{-120}}\times\\{\left(1\times{2}\times{3}\times{4}\right)}\times{\left(6\times{7}\times{8}\times{9}\right)}\times{\ldots\times{\left(596\times{597}\times{598}\times{599}\right)}} .

Let us observe all product of each black item in the bracket. We can see that all last three digits of the product is 24 24 . So, we can say that the last three digits of

600 ! 10 120 ( 120 ! ) × 2 120 ( × 24 × 24 × 24 × 24 ) 120 times ( 120 ! ) ( × 12 × 12 × 12 × 12 ) 120 times ( 120 ! ) × 12 120 ( m o d 1000 ) \begin{array}{c}&\dfrac{600!}{{10}^{120}}&\equiv\color{#D61F06}{\left(120!\right)}\times{2^{-120}}\underbrace{\left(\times{24}\times{24}\times{24}\ldots\times{24}\right)}_\text{120 times}\\&\equiv\color{#D61F06}{\left(120!\right)}\underbrace{\left(\times{12}\times{12}\times{12}\ldots\times{12}\right)}_\text{120 times}\equiv\color{#D61F06}{\left(120!\right)}\times{{12}^{120}}\pmod{1000}\end{array}

Using same method above, we will determine the last three digits non zero of ( 120 ! ) \color{#D61F06}{\left(120!\right)} .

120 ! 10 24 ( 24 ! ) × 12 24 ( m o d 1000 ) \begin{array}{c}&\dfrac{120!}{{10}^{24}}&\equiv\color{#D61F06}{\left(24!\right)}\times{{12}^{24}}\pmod{1000}\end{array}

And the last for 24 ! ~\color{#D61F06}{24!}

24 ! 10 4 ( 4 ! ) × 21 × 22 × 23 × 24 × 12 4 576 × 12 4 ( m o d 1000 ) \dfrac{24!}{{10}^{4}}\equiv\color{#D61F06}{\left(4!\right)}\times{21}\times{22}\times{23}\times{24}\times{{12}^{4}}\equiv576\times{{12}^{4}}\pmod{1000} .

Finally, we have

600 ! 10 120 12 ( 120 + 24 + 4 ) × 576 12 ( 148 ) × 576 ( m o d 1000 ) \begin{array}{c}&\dfrac{600!}{{10}^{120}}&\equiv{12}^{(120+24+4)}\times{576}\equiv{12}^{(148)}\times{576}\pmod{1000}\end{array} .

For simplicity, we will work with modulo 8 8 and 125 125 to use Euler's theorem. Now we have:

4 148 { 16 74 0 ( m o d 8 ) ( 4 ϕ ( 125 ) ) × 4 48 86 ( m o d 125 ) 4^{148}\equiv\begin{cases}{16}^{74}\equiv0\pmod{8}\\\left(4^{\phi(125)}\right)\times{4^{48}}\equiv86\pmod{125}\end{cases}

and 3 148 { 9 74 1 ( m o d 8 ) ( 3 ϕ ( 125 ) ) × 3 48 111 ( m o d 125 ) ~~3^{148}\equiv\begin{cases}9^{74}\equiv1\pmod{8}\\\left(3^{\phi(125)}\right)\times{3^{48}}\equiv111\pmod{125}\end{cases}

Note that ϕ ( 125 ) = ( 1 1 5 ) × 125 = 100 \phi(125)=\left(1-\dfrac{1}{5}\right)\times{125}=100

By using Chinese Reminder Theorem we shall get that 4 148 336 ( m o d 1000 ) 4^{148}\equiv336\pmod{1000}~~ and 3 148 361 ( m o d 1000 ) ~~3^{148}\equiv361\pmod{1000}

Hence,

600 ! 10 120 4 148 × 3 148 × 576 336 × 361 × 576 69866496 496 ( m o d 1000 ) \begin{array}{c}&\dfrac{600!}{{10}^{120}}&\equiv{4}^{148}\times{3^{148}}\times{576}\equiv336\times{361}\times{576}\equiv69866496 \\&\equiv\boxed{\boxed{\huge{496}}}\pmod{1000}\end{array} .

Therefore, the final answer is 4 + 9 + 6 = 19 4+9+6=19

You can check this for other similar problem

Aryan Gaikwad
Apr 1, 2015

Here's my java solution. I had to use BigInteger instead of double because factorial of 600 simply exceeds the max limit of double.

1
2
3
4
5
6
7
8
BigInteger fact = new BigInteger("1");
for(int n = 1; n <= 600; n++)
    fact = fact.multiply(BigInteger.valueOf(n));
String ans = fact.toString().replace("0", "");
int sum = 0;
for(int n = 1; n <= 3; n++)
    sum += Character.getNumericValue(ans.charAt(ans.length() - n));
System.out.println(sum);

That's good!

Challenge : Try without any computational device!

Harsh Shrivastava - 6 years, 2 months ago

Log in to reply

can u please reveal the number theory solution?

Sarthak Rath - 6 years, 1 month ago

Hi Harsh Shrivastava, can you post a solution? It would certainly benefit the community. Thank you!

Brilliant Mathematics Staff - 6 years, 1 month ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...