I know the inverse of [23] is
[23] * [25] = 575
575 congruent to 1 mod 41
[25] is the inverse
I have started the other one but I am doing something wrong I got
[2] * [41] = [82] = [0]
82 congruent to 0 mod 41
I thought 41 would be the inverse but it is not.
Here is a general method for finding the inverse of $a$ in $Z_n$:
And here is an equivalent code in C:
Calling
Inverse(41,2)
returns $21$.Calling
Inverse(41,23)
returns $25$.