Euclid’s algorithm:
3000=15⋅197+45197=4⋅45+1745=2⋅17+1117=11+611=6+56=5+1
The inverse procedure:
1=6−5=(17−11)−(11−6)=17−2⋅11+6==(197−4⋅45)−2(45−2⋅17)+(17−11)==197−6⋅45+5⋅17−11==197−6(3000−15⋅197)+5(197−4⋅45)−(45−2⋅17)==−6⋅3000+96⋅197−21⋅45+2⋅17==−6⋅3000+96⋅197−21(3000−15⋅197)+2(197−4⋅45)==−27⋅3000+413⋅197−8⋅45==−27⋅3000+413⋅197−8(3000−15⋅197)==−35⋅3000+533⋅197
Then
197⋅533=1mod3000⇒197−1=533mod3000
Comments
Leave a comment