Friday, October 20, 2017

Finding the Modular Multiplicative Inverse of a large number



I am practicing some modular arithmetic and I am trying to find the multiplicative inverse of a large number.
Here is the problem:




345^-1 mod 76408



I'm not sure how to go about solving this problem. I set it up the following way:



x = 345^-1 mod 76408



345x = 1 mod 76408



76408 = 345 * 221 + 163




345 = 163 * 2 + 19



163 = 19 * 8 + 11



19 = 11 * 1 + 8



11 = 8 * 1 + 3



8 = 3 * 2 + 2




3 = 2 * 1 + 1



2 = 1 * 2



I watched a video where i would then use the extended euclidean algorithm, but I'm unsure as to how to do it.



Any help/advice to solve this would be appreciated! Thanks.


Answer



Here is a way of writing things: qi and ri are the quotient and the remainder of the i-th division, ui and vi are Bézout's coefficients of ri relative to 76408 and 345 respectively.




The recurrence relations are ui+1=ui1qiui,vi+1=vi1qivi.



riuiviqi7640810345012211631221219244381117376518194208133679732291201541112728127



So 1=1277640828127345 from which we conclude 34512812748281mod76408.



No comments:

Post a Comment

analysis - Injection, making bijection

I have injection f:AB and I want to get bijection. Can I just resting codomain to f(A)? I know that every function i...