A382221 Products of primitive roots when n is 2, 4, p^k, or 2p^k (with p an odd prime), for all other n the value is defined to be 1.
1, 1, 2, 3, 6, 5, 15, 1, 10, 21, 672, 1, 924, 15, 1, 1, 11642400, 55, 163800, 1, 1, 29393, 109681110000, 1, 64411776, 21945, 708400, 1, 5590307923200, 1, 970377408, 1, 1, 644812245, 1, 1, 134088514560000, 11756745, 1, 1, 138960660963091968000, 1
Offset: 1
Keywords
Links
- Michael De Vlieger, Table of n, a(n) for n = 1..838
- Wikipedia, Primitive root modulo n.
Programs
-
Mathematica
Table[Times @@ PrimitiveRootList[n], {n, 42}] (* Michael De Vlieger, Apr 07 2025 *)
-
Python
from sympy import gcd, primitive_root, totient def a(n): try: g = primitive_root(n) except ValueError: return 1 P = 1 if g: phi = totient(n) for k in range(1, phi): if gcd(k, phi) == 1: P *= pow(g, k, n) return P print([a(n) for n in range(1,43)])