These Numbers Are Way Too Huge!

Find the greatest common divisor of the two numbers 2016 ! + 1 2016! + 1 and 2017 ! 2017! .

Note: 2017 is prime .
Notation: ! ! is the factorial notation. For example, 8 ! = 1 × 2 × 3 × × 8 8! = 1\times2\times3\times\cdots\times8 .


The answer is 2017.

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

Rui-Xian Siew
Nov 1, 2016

According to Wilson's theorem ,

( p 1 ) ! 1 ( m o d p ) (p-1)!\equiv -1\quad (mod\quad p)

for prime p. Since 2017 is a prime, hence ( 2016 ) ! + 1 0 ( m o d 2017 ) 2016 ! + 1 i s a m u l t i p l e o f 2017 (2016)!+1\equiv 0(mod\quad 2017) \Rightarrow 2016!+1\quad is\quad a\quad multiple\quad of\quad 2017 .

For all prime p < 2017 p<2017 , ( 2016 ) ! 0 ( m o d p ) ( 2016 ) ! + 1 1 ( m o d p ) (2016)!\equiv 0(mod\quad p)\quad \Rightarrow (2016)!+1\equiv 1(mod\quad p)

hence 2016!+1 is not a multiple of any prime number smaller than 2017.

The greatest prime divisor of 2017! is 2017. Since this is the only prime divisor shared by these two numbers, it is the greatest common divisor.

No, I first learned Wilson's theorem from Brilliant when I read people's solution.

Rui-Xian Siew - 4 years, 7 months ago

Log in to reply

Woohoo wilson's theorem !

Calvin Lin Staff - 4 years, 7 months ago

did you learn this from mumberphile

Razzi Masroor - 4 years, 7 months ago

@Calvin Lin thanks for adding the link!

Rui-Xian Siew - 4 years, 7 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...