Ask Your Question
1

Powers in modular arithmetic

asked 2024-03-26 12:10:20 +0100

Emm gravatar image

How can I detect if an integer n modulo q (not necessary a prime number) is a b-power for a given integer b?

Something like Integers(q)(n).is_power(b) that would return:

  • true if there exists $k$ such that n=k^b\pmod{q}
  • false otherwise.
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2024-03-26 14:20:58 +0100

Max Alekseyev gravatar image

Perhaps, the easiest way is to use pari.ispower():

pari.ispower(Mod(n,q), b)
edit flag offensive delete link more

Comments

That's perfect, thanks! I had forgotten how to access pari commands...

Emm gravatar imageEmm ( 2024-03-26 15:02:10 +0100 )edit

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: 2024-03-26 12:10:20 +0100

Seen: 175 times

Last updated: Mar 26