Please does somebody know of an online list or tool (if possible server side, not a Java applet running in my computer) to calculate the primitive roots modulo n, for instance $n \in [1,1000]$ (apart from the Wikipedia list)?
I know this site (link) which is very good, but it just calculates the primivite roots modulo a prime number, and I would like to check it for other values (if I am not wrong $n = 4, p^k$ and $2p^k$ where p is an odd prime would also have primitive roots modulo n).
I have been searching in the old questions, but I did not find it. If this was already asked I will remove the question. Thank you!
UPDATE:
Thank you very much for the code in the answers! I have made also my own Python code, but I would like to know if there is an online list or tool, it could be helpful for somebody else. Here is my (very brute force) version:
from sympy import is_primitive_root
def prim_root_prod(value):
prlist = []
for i in range (1,value):
if is_primitive_root(i,value):
prlist.append(i)
return prlist
I don't have an online tool, but what you want seems to be the example from OEIS A046147. You might be able to tweak the Mathematica example and send it through WolframAlpha.
I give an example in the documentation for perl/ntheory for constructing that table. There's no online way to run it (that I know of) but just in case you want it:
All these functions are available in Pari/GP so it should be easy to do something similar with it.