Challenges - Number Theory

If B is modular multiplicative inverse of A under mod M where ( A.B=1 mod M ) . Find the exact range of B.

As, B = A^(M-2)%M shouldn’t the range be [0,M-1] ?

hello @deep4013

a) the formula that u r using is valid only if M is prime

b) mod inverse cannot be zero because of its definition.

A . B=1 here B can be mod inverse only for range {1…m-1}
it cant be zero becuase A*0 cant be 1 under any condtion

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.