Playing with large numbers

Find the remainder when 999 , 999 ! 999,999! is divided by 1 , 000 , 003 1,000,003 .

Note: We are told that 1,000,003 is prime.


Inspiration


The answer is 833336.

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.

1 solution

Naren Bhandari
Dec 11, 2018

From Wilson theorem we can have following 1000002 ! 1 m o d ( 1000003 ) 1000002 !\equiv -1\mod(1000003) and ( 6 ) × 999999 ! 1 m o d ( 1000003 ) (-6)\times 999999! \equiv -1\mod(1000003) Now we wish to find the modulo inverse of 6 m o d ( 1000003 ) 6\mod(1000003) . Since 1000003 = 6 ( 166667 ) + 1 1000003 =6(166667)+1 Therefore, 999999 ! 166667 m o d ( 1000003 ) 999999 ! 833336 m o d ( 1000003 ) 999999!\equiv -166667\mod(1000003)\implies 999999!\equiv 833336\mod(1000003) So, 833336 \boxed{833336} is the required answer.

Very nicely done! Thank you!

Otto Bretscher - 2 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...