Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate the Modular multiplicative inverse in pari?

Tags:

pari-gp

pari

The modular multiplicative inverse is an integer ‘x’ such that.

a x ≡ 1 (mod m).

So, is there any way to calculate the Modular multiplicative inverse in pari\gp calculator ?

I am really sorry if this question is trivial or duplicated.

like image 588
عبد الرحمن رمزي محمود Avatar asked Oct 24 '25 10:10

عبد الرحمن رمزي محمود


1 Answers

Just Mod(1/a, m), where a and m are your relatively prime numbers. See example for a = 3 and m = 1133 below.

lift(Mod(1/3, 1133))
> 378
like image 60
Piotr Semenov Avatar answered Oct 28 '25 02:10

Piotr Semenov