Find the remainder when 2 0 1 6 ! − 2 0 1 5 ! is divided by 2 0 1 7 .
You may use the fact that 2 0 1 7 is prime.
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.
Daniel Liu, please create another answer possibility if it is possible to do so on brilliant: -2. I lost the first try of solution just because -2 is marked as wrong.
Log in to reply
Remainders must be in the range [0, 2016] in this problem because that is the definition of a remainder.
I agree with @Colin Tang and @Vinayak Shukla . Remember that remainders cannot be negative, no matter what. Even i they could, I still could not create two possible correct answers, so sorry.
You should have tried 2015, we can't put negative remainders, I guess.
Me too....
I think ( p − 2 ) ! ≡ 1 ( mod p ) not − 1 .
Alternative, just figure out what ( p − 2 ) ! is ( m o d p ) which is easily 1 since you can pair up the numbers into 2 p − 1 pairs in the product to get 1 ( m o d p ) . From there, you can consequently get ( p − 1 ) ! ≡ p − 1 ( m o d p )
First note that for a prime p , Wilson's theorem states that: ( p − 1 ) ! ≡ p − 1 ≡ − 1 ( m o d p ) . As a direct consequence (by dividing by p − 1 ), we can see that ( p − 2 ) ! ≡ 1 ( m o d p ) . As 2 0 1 7 is a prime, we have: 2 0 1 6 ! − 2 0 1 5 ! = ( 2 0 1 7 − 1 ) ! − ( 2 0 1 7 − 2 ) ! ≡ − 1 − 1 = − 2 ≡ 2 0 1 5 ( m o d 2 0 1 7 )
good solution
Since 2 0 1 6 ≡ − 1 m o d 2 0 1 7 . So, 2 0 1 6 ( − 1 ) ≡ 1 m o d 2 0 1 7 . It implies that − 1 is the inverse of 2016 modulo 2017. So, 2 0 1 5 ! ≡ 2 0 1 6 ! × 2 0 1 6 − 1 ≡ 2 0 1 6 ! × ( − 1 ) ≡ − 2 0 1 6 ! ≡ 1 m o d 2 0 1 7 . So, 2 0 1 6 ! − 2 0 1 5 ! ≡ − 1 − 1 ≡ − 2 ≡ 2 0 1 5 m o d 2 0 1 7 .
Good observation and explanation!
I think this answer is wrong because.... (2016!-2015)/2017 =2015! (2015)/2017 =2017!2015/(2015.2016.2017) =2015!
So remainder is 0
2 0 1 6 ! − 2 0 1 5 ! = 2 0 1 5 ∗ 2 0 1 5 !
By Wilson's Theorem, 2 0 1 6 ! ≡ 2 0 1 6 ( m o d 2 0 1 7 )
So, 2 0 1 5 ! ≡ 1 ( m o d 2 0 1 7 )
⟹ ( 2 0 1 5 ! ) 2 0 1 5 ≡ 2 0 1 5 ( m o d 2 0 1 7 )
So this solution relies more on seeing a pattern:
The first few factorials are as follows: 3! - 2! = 4 4! - 3! = 18 5! - 4! = 96 6! - 5! = 600 7! - 6! = 4320
The next thing to do is to divide the equations by the next factor and see what the remainders are, for example:
(3! - 2!)/4 = 1 with no remainder. However (4! - 3!)/5 has a remainder of 3, which is the b in (a! - b!)/c. Notice that 5 is a prime. (5! - 4!)/6 = 16 with no remainder. (6! - 5!)/7 has a remainder of 5, again the b and 7 being a prime.
Thus, I figured that if the equation is (a! - b!)/c and c is a prime, then the remainder should be b.
(2016! - 2015!)/2017 has a remainder of 2015.
since 2017 is prime, it has no divisor less than 2017. 2016! -2015! = (2016 - 1) * 2015! = 2015 * 2015! since 2015! is the product of all positive integers less than or equal to 2015, the remainder is the sum of all divisors times 2015 = -2 (mod 2017) the sum is 2 ( 2 0 1 5 + 1 ) ( 2 0 1 5 ) , and when multiplied by -2, the result is 2 2 0 1 6 ∗ ( − 2 ) 2 = 2 0 1 6 ∗ 2 = − 1 ∗ 2 = − 2 = 2 0 1 5
2015 or -2. From wilson 2016!=-1mod2017. Hence 2016 2015!=-1mod2017 => (2017-1) 2015!=-1mod2017 => 2015!=1mod2017. Overall the remainder is -2
Problem Loading...
Note Loading...
Set Loading...
We generalize it to find the remainder for ( p − 1 ) ! − ( p − 2 ) ! when it's divided by prime p
By Wilson's Theorem, ( p − 1 ) ! ( m o d p ) ≡ − 1
⇒ ( p − 1 ) ( p − 2 ) ! ( m o d p ) ≡ − 1
⇒ ( p − 2 ) ! ( m o d p ) ≡ − ( p − 1 1 ) ≡ 1 , because 1 ( p ) − 1 ( p − 1 ) = 1
Thus, ( p − 1 ) ! − ( p − 2 ) ! ( m o d p ) ≡ − 2 ≡ p − 2 .
In this case, p = 2 0 1 7 ⇒ p − 2 = 2 0 1 5