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=ui−1−qiui,vi+1=vi−1−qivi.
riuiviqi7640810345012211631−221219−244381117−376518−1942081336−797322−912015411127−28127
So 1=127⋅76408−28127⋅345 from which we conclude 345−1≡−28127≡48281mod76408.
No comments:
Post a Comment