Verify that $x$ is a primitive root modulo $n$

265 Views Asked by At

I have a question.

How can we the quickest to test whether $x$ is a primitive root modulo $n$?

On the Wikipedia page I found information about a possible algorithm.

This algorithm, however, must know all the divisors.

I found the question: Here, but I did not understand much (I need test number $x$).

Can you think of something?

Can this be done in a polynomial time?