![]() |
![]() |
#1 |
"Michael"
Aug 2006
Usually at home
22·3·7 Posts |
![]()
Do you think this would be faster than the extended Euclidean Algorithm for finding inverses?
For a given a find a-1 (mod m) 1. Let m = r mod a 2. Find r -1 mod a 3. Let x = a - r -1 (ie, x = -r -1 mod a) 4. a-1 mod m = (xm + 1)/a If this algorithm is applied recursively, at step 2., it should be possible to reduce the question finding the inverse of a small number and then working back up the chain to find the original inverse. The reasoning is as follows:- aa-1 = km + 1, for some k < a, so km = -1 (mod a) That is, k = -m -1 (mod a) Adding 1, km + 1 = 0 (mod a) Whence, (km + 1)/a = a-1 (Moderator, I meant to post this in the computing forum but posted here by mistake.) Last fiddled with by mgb on 2019-10-25 at 20:45 |
![]() |
![]() |
![]() |
#2 | |
Feb 2017
Nowhere
633910 Posts |
![]() Quote:
Last fiddled with by Dr Sardonicus on 2019-10-26 at 13:51 Reason: Rephrasing |
|
![]() |
![]() |
![]() |
#3 | |
"Michael"
Aug 2006
Usually at home
22×3×7 Posts |
![]() Quote:
Example: Find 17 -1 mod 223 -223 -1 = 8 mod 17 (8*223 + 1)/17 = 105 = 17 -1 mod 223 Last fiddled with by mgb on 2019-10-26 at 19:41 |
|
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
P-adic inverses | devarajkandadai | Number Theory Discussion Group | 1 | 2018-11-10 05:17 |
calculating with circles | diep | Homework Help | 9 | 2014-07-12 12:14 |
Calculating E based on B1 | c10ck3r | Math | 1 | 2012-02-22 06:29 |
Calculating a difficult sum | CRGreathouse | Math | 3 | 2009-08-25 14:11 |
Can I quickly unreserve & get my assignments back? | petrw1 | PrimeNet | 18 | 2008-11-15 23:51 |