Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question
1

Powers in modular arithmetic

asked 1 year ago

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.
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 1 year ago

Max Alekseyev gravatar image

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

pari.ispower(Mod(n,q), b)
Preview: (hide)
link

Comments

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

Emm gravatar imageEmm ( 1 year ago )

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: 1 year ago

Seen: 206 times

Last updated: Mar 26 '24