Comparing Two Gigantic Numbers

Find the greatest common divisor of the two numbers, 886 ! + 1 886! + 1 and 887 ! 887! .

Notation :
! ! denotes the factorial notation. For example, 10 ! = 1 × 2 × 3 × × 10 10! = 1\times2\times3\times\cdots\times10 .


The answer is 887.

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

Notice that 887 887 is prime. Wilson's theorem states that ( p 1 ) ! 1 ( m o d p ) (p-1)! \equiv -1 \pmod p where p p is a prime number. Therefore 886 ! + 1 886!+1 is divisible by 887 887 and so is 887 ! 887!

This is indeed the greatest common factor which is possible as gcd ( 887 ! , 886 ! + 1 ) = gcd ( 887 ! , 887 n ) = 887 × gcd ( 886 ! , n ) = 887 \gcd(887!,886!+1)=\gcd(887!,887n)=887×\gcd(886!,n)=887 as for some integer n n ,

887 n 887n divides 886 ! + 1 886!+1 , an odd number which implies n n is odd and the result.

A little logic would suffice too.Note that 886!+1 887! could have gcd less than them 1,2,3,4,............................887 Since All of them leave remainder 1 when divided by first number there gcd is either 1 or 877 Try both and BINGO!!! I did use wilson theorem but i thought this would be a good way too for logic

Kaustubh Miglani - 5 years, 3 months ago

Log in to reply

Why can't 1 be the gcd then? :-P

Akshat Sharda - 5 years, 3 months ago

Log in to reply

U see U have three answer trials

Kaustubh Miglani - 5 years, 3 months ago

Log in to reply

@Kaustubh Miglani How was your JSTSE result?

Kushagra Sahni - 5 years, 2 months ago

Log in to reply

@Kushagra Sahni He came 2nd.

Mehul Arora - 5 years, 2 months ago

Log in to reply

@Mehul Arora And what about you?

Kushagra Sahni - 5 years, 2 months ago

Log in to reply

@Kushagra Sahni I'm 82nd. Isn't as good, but It'll have to do :/

Mehul Arora - 5 years, 2 months ago

Log in to reply

@Mehul Arora Getting selected also is a great achievement, keep it up.

Kushagra Sahni - 5 years, 2 months ago

@Mehul Arora Please I am Ashamed of it.Pls dont tell anyone about this @Mehul Arora @Kushagra Sahni

Kaustubh Miglani - 5 years, 2 months ago

@Kaustubh Miglani Lol! I posted this question!

Akshat Sharda - 5 years, 3 months ago

Log in to reply

@Akshat Sharda LOL. @Kaustubh Miglani you must uphold the spirit of solving a problem. If I post a question saying 1+1 for example, you can't try 0,1 and 2 to get the answer right.

You should be able to get it right in one go, and not rely on luck to get the answer correct for you. Three tries are provided if in case you commit a calculation error, you can start over and get the correct answer.

However, I am not accusing you of anything.

Mehul Arora - 5 years, 3 months ago

Log in to reply

@Mehul Arora As I said I did it by Wilsons theorem.It just came to me and I thought it would be better too

Kaustubh Miglani - 5 years, 3 months ago

Brilliant use of Wilson's theorem. +1.

Mehul Arora - 5 years, 3 months ago

I think there is a flaw : Your last but one statement says 887 ( 886 ! + 1 ) 887|(886!+1) and 887 887 ! 887|887! . But this need not directly mean that g c d ( 886 ! + 1 , 887 ! ) = 887 gcd(886!+1,887!)=887 .

Venkata Karthik Bandaru - 5 years, 3 months ago

Log in to reply

I have posted the explanation in my solution now.

A Former Brilliant Member - 5 years, 3 months ago

Log in to reply

@Svatejas Shivakumar The other posted solution was indeed wrong, and the flaw didn't come across me that time. Thanks for pointing it out :).

Venkata Karthik Bandaru - 5 years, 3 months ago

Can anyone explain to me how 887 x gcd(886!, n) = 887 (as stated in Svatejas' answer)

Khoa Nguyen - 5 years, 2 months ago

Log in to reply

nevermind i got it im such an idiot hahaha

Khoa Nguyen - 5 years, 2 months ago
Pham Khanh
Apr 17, 2016

First, we got: k 886 ! ( k 1 ; 886 ) k|886!(\forall k \in \overline{1;886}) So 886 ! + 1 1 ( m o d k ) 886!+1\equiv 1 \pmod {k} And apply Wilson's Theorem, we have: 886 ! + 1 ( 1 + 1 ) 0 ( m o d 887 ) ( b e c a u s e 887 i s p r i m e ) 886!+1\equiv (-1+1)\equiv 0 \pmod {887}(because~887~is~prime) So the only common factor, which is also the answer, is 887 \boxed{887}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...