You are viewing a single comment's thread. Return to all comments →
You need to calculate factorials using method posted in first reply.
a = 499! (mod p) b = 500! (mod p) where, 0 <= a, b < p
Now problem reduces to
1/(a*b) = (a*b)^-1 (mod p) = c^-1 (mod p) = c^(p-2) (mod p) where, c = (a*b)%p
Now use fast exponential method, posted in last reply, to calculate higher power.
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and Permutations
You are viewing a single comment's thread. Return to all comments →
You need to calculate factorials using method posted in first reply.
Now problem reduces to
Now use fast exponential method, posted in last reply, to calculate higher power.