Ask Your Question
0

Close the inverse element according to the given module

asked 2020-09-29 19:41:26 +0200

shohruh0905 gravatar image

updated 2024-04-14 16:01:23 +0200

FrédéricC gravatar image

Number Theory. Close the inverse element according to the given module. Found using the Eyler function a^(f(n)-1)(modn) f(n)- Eyler function

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2020-09-29 21:36:46 +0200

slelievre gravatar image

There are various ways to compute the inverse of a number modulo some other number.

They include

  • using the function inverse_mod.
  • working in the ring of integers modulo n.

Using inverse_mod:

sage: n = 14
sage: a = 5
sage: b = inverse_mod(a, n)

sage: b
3
sage: a * b
15
sage: (a * b) % n
1

Using the ring of integers modulo n:

sage: n = 14
sage: A = Zmod(n)
sage: a = A(5)
sage: a
5

sage: b = a^-1
sage: b
3
sage: b * a
1
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-09-29 19:41:26 +0200

Seen: 116 times

Last updated: Sep 29 '20