Solving a Single Congruence Equation
|
03-08-2019, 11:34 PM
(This post was last modified: 03-09-2019 02:11 PM by Albert Chan.)
Post: #12
|
|||
|
|||
RE: Solving a Single Congruence Equation
(03-08-2019 07:16 PM)Albert Chan Wrote: Example: solve 12345 x ≡ 1 (mod N), with N = 17789, for x For comparison, this build 17789/5444 continued fraction convergents P/Q Code: (next column) = CF * (current column) + (prev column) Q values are not needed here ... 12345 * 8107 ≡ 1 (mod N), thus x ≡ 1/12345 ≡ 8107 (mod N) Edit: it might be cheaper to do Q row instead, since Q's < ½ P's P's = round(Q's * fraction) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)