What is the remainder when 7 0 9 ! is divided by 719?
Details and assumptions
You may use the fact that 7 0 9 and 7 1 9 are both primes.
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.
Great explanation. This solution also shows you how 719 was specially chosen, to reduce the amount of tedious calculation that has to be done, because 720 is so highly factorable.
You have a couple typos where you say 719! instead of 709! on your second and third math lines. Apart from that, very good solution!
Log in to reply
Darn. Thanks
Log in to reply
Edited.
Log in to reply
@Calvin Lin – Are you the challenge master?
@Calvin Lin – Any other way , unable to understand it , don't know what is mod?.got wrong
Can't it be solved without Wilson's Theorem??
Can you show how you got 7 ⋅ 8 ⋅ 9 1 ≡ 7 1 0 ( m o d 7 1 9 ) ?
Log in to reply
Notice that 8 ⋅ 9 ⋅ 1 0 ≡ 1 ( m o d 7 1 9 ) Then 7 ⋅ 8 ⋅ 9 1 ≡ 7 ⋅ 8 ⋅ 9 ⋅ 1 0 1 0 ≡ 7 1 0 ( m o d 7 1 9 )
Log in to reply
I still don't get it, i know if 8 ⋅ 9 ⋅ 1 0 ≡ 1 ( m o d 7 1 9 ) but how to do this 1 0 / 7 ⋅ 8 ⋅ 9 ⋅ 1 0 ≡ 1 0 / 7 ( m o d 7 1 9 ) can happen? the 7 no included to be mod?
then ater that, 1 0 / 7 ≡ 1 0 3 0 / 2 ≡ 5 1 5 ( m o d 7 1 9 ) only 7 who get mod?
Log in to reply
@Hafizh Ahsan Permana – So, you understand why 8 ⋅ 9 ⋅ 1 0 ≡ 1 ( m o d 7 1 9 ) .
Now, multiply by 1 0 1 0 : 7 ⋅ 8 ⋅ 9 1 ≡ 7 ⋅ 8 ⋅ 9 1 ⋅ 1 0 1 0 ≡ 7 ⋅ 8 ⋅ 9 ⋅ 1 0 1 0 ≡ 7 ⋅ ( 8 ⋅ 9 ⋅ 1 0 ) 1 0 ≡ 7 ⋅ 1 1 0 ≡ 7 1 0 ( m o d 7 1 9 )
The other step is similar.
What an elegant solution!
mind telling me how you got to 709! ≡ (−10)(−11)⋯(−718) (mod719) ?
Log in to reply
We know that 7 0 9 ≡ − 1 0 ( m o d 7 1 9 )
This is because equivalence modulo 719 means that, for an integer k , 7 0 9 + 7 1 9 k = − 1 0 This equation is satisfied for k = − 1 .
Similarly, 7 0 8 ≡ − 1 1 ( m o d 7 1 9 ) and so on.
1 = -718, 2 = -717, ..., 709 = -10 (all equal signs meaning congruence mod 719).
Ingenious but I don't get the part where 'since there is an odd number of terms...' what happens if there are an even number of terms?
Log in to reply
There is an odd number of terms. If there was an even number of terms the answer would have a negative sign in front.
Since 7 1 9 is prime, we can apply Wilson's Theorem to get that 7 1 8 ! ≡ − 1 m o d 7 1 9 . This can be written as
7 0 9 ! ⋅ 7 1 0 ⋅ 7 1 1 ⋯ 7 1 8 ≡ 7 0 9 ! ⋅ − 9 ⋅ − 8 ⋯ − 1 ≡ 7 0 9 ! ⋅ − 9 ! ≡ − 1 m o d 7 1 9 .
This give us 7 0 9 ! ⋅ 7 2 ⋅ 7 ⋅ 7 2 0 ≡ 1 m o d 7 1 9 .
We now reduce the expression m o d 7 1 9 :
7 0 9 ! ⋅ 7 2 ⋅ 7 ⋅ 7 2 0 ≡ 1 + 7 1 9 ≡ 7 2 0
7 0 9 ! ⋅ 7 2 ⋅ 7 ≡ 1 + 7 1 9 ≡ 7 2 0
7 0 9 ! ⋅ 7 ≡ 1 0 + 5 ⋅ 7 1 9 ≡ 3 6 0 5
7 0 9 ! ≡ 5 1 5
Thus the remainder when 7 0 9 ! is divided by 7 0 9 is 5 1 5
Very nice! Your reductions modulo 7 1 9 are a bit unusual, but very effective.
Very precise and comprehensible. the reductions were very clear and understandable. Thank you for your solution.
We are given that 7 1 9 is prime, hence by Wilson's theorem 7 1 8 ! ≡ − 1 ( m o d 7 1 9 ) Therefore 7 0 9 ! ⋅ 7 1 0 ⋅ 7 1 1 ⋯ 7 1 8 ≡ 7 0 9 ! ⋅ ( − 9 ) ( − 8 ) ( − 7 ) ⋯ ( − 1 ) ( m o d 7 1 9 ) ≡ − 9 ! ⋅ 7 0 9 ! ( m o d 7 1 9 ) ≡ 2 1 5 ⋅ 7 0 9 ! ( m o d 7 1 9 ) Hence 2 1 5 ⋅ 7 0 9 ! ≡ − 1 ( m o d 7 1 9 ) This is linear congruence generally solvable by Euclidean algorithm. Thus using Euclidean algorithm we get 7 0 9 ! ≡ 5 1 5 ( m o d 7 1 9 )
The Euclidean Algorithm works, of course. But easier solutions exist in this particular case.
How does the -9! change to 215?
Let p=719. By wilsons theorem, 718! == 1 mod p == 709! * (-9)(-8)(-7)...(-1) == 709! (504) where == denotes equivalence. We can solve for the residue of 709! trivially from here.
(p-1)!=-1 mod p by Wilson's theorem. Hence 709!x710x711...718=718 mod 719. To make the arithmetic simpler equivalently we have: 709!x(-9)(-8)...(-3)(-2)=1 mod 719 or 709!x(-1)^8x9x8x7x6!=1 mod 719 but note that 719 = 6!-1 hence 709!x9x8x7x(719+1)=1 mod 719 i.e. 709!x9x8x7=1 mod 719. Hence we just need to find the multiplicative inverse of 9x8x7 = 504 in the group mod 719. This can be done by Euclid's Algorithm since hcf(504,719)=1 means there exist a,b in Z such that 504xa+719xb=1, in which case a = 504^(-1), hence 709! = a mod 719. This yields the answer given.
The question can be translated into: "What is 709! mod 719?"
As 719 is prime, use Wilson's Theorem, and we get 718! mod 719 = 718. We then work backwards.
717! mod 719 = a, where a is an integer such that 718a mod 719 = 718. We solve the equation and get a = 1. Work backwards similarly, until we get the desired answer, that is: 709! mod 719 = 515.
We calculate the remainder by using a simple loop in javascript:
var n=1;
for(var i=2 ; i <= 709 ; i++)
n = n * i % 719;
which will multiply all 709 number and get the remainder for each turn. Because 709 is rather small, we can afford this.
By Wilson's Theorem, since 719 is prime we have 718! = -1 (mod 719). Now, 718! = 709! * 710 * 711 * ... * 718. Since we're working mod 719, we can rewrite 710 as -9, 711 as -8, and so on up to 718 as -1. Therefore, 709! * (-9!) = -1 (mod 719). Hence 709! * (9!) = 1 (mod 719). Now observe that 6! = 720 = 1 (mod 719), so we can cancel a 6! out of the 9 factorial. We get 709! * (7 * 8 * 9) = 1 (mod 719), so 709! = (504)^(-1) (mod 719). To find the inverse of 504 we simply use the Bezout algorithm, and get 515.
Problem Loading...
Note Loading...
Set Loading...
Note that 7 0 9 ! ≡ ( − 1 0 ) ( − 1 1 ) ⋯ ( − 7 1 8 ) ( m o d 7 1 9 ) Since there is an odd number of terms, this is also equivalent to 7 0 9 ! ≡ − 9 ! 7 1 8 ! ( m o d 7 1 9 ) By Wilson's Theorem (iff p is prime, ( p − 1 ) ! ≡ − 1 ( m o d p ) ), 7 0 9 ! ≡ 9 ! 1 ( m o d 7 1 9 ) Notice that 6 ! ≡ 7 2 0 ≡ 1 ( m o d 7 1 9 ) , and so we calculate as follows: 9 ! 1 ≡ 6 ! 1 ⋅ 7 ⋅ 8 ⋅ 9 1 ≡ 7 ⋅ 8 ⋅ 9 1 ( m o d 7 1 9 ) Now, notice that 8 ⋅ 9 ⋅ 1 0 ≡ 1 ( m o d 7 1 9 ) , and so 7 ⋅ 8 ⋅ 9 1 ≡ 7 1 0 ( m o d 7 1 9 ) Finally, 7 ⋅ 1 0 3 ≡ 2 ( m o d 7 1 9 ) , and we find our answer: 7 1 0 ≡ 2 1 0 3 0 ≡ 5 1 5 ( m o d 7 1 9 )