Ask Your Question
0

Close the inverse element according to the given module

asked 2020-09-29 12:41:26 -0500

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 14:36:46 -0500

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 12:41:26 -0500

Seen: 42 times

Last updated: Sep 29