Ask Your Question
0

Close the inverse element according to the given module

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

shohruh0905 gravatar image

updated 2024-11-20 08:25:25 +0100

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 +0100

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 +0100

Seen: 166 times

Last updated: Sep 29 '20