OFFSET
1,2
COMMENTS
Except for n=2, we have a(n)=1 (mod prime(n)).
REFERENCES
C. F. Gauss, Disquisitiones Arithmeticae, Yale, 1965; see p. 52.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..145
EXAMPLE
a(5)=672 because the primitive roots of 11 are {2,6,7,8}.
MATHEMATICA
PrimRoots[p_] := Select[Range[p-1], MultiplicativeOrder[ #, p]==p-1&]; Table[Times@@PrimRoots[Prime[n]], {n, 20}]
Times@@@Table[PrimitiveRootList[Prime[n]], {n, 20}] (* Harlan J. Brothers, Sep 02 2023 *)
PROG
(PARI) vecprod(v)=prod(i=1, #v, v[i])
a(n, p=prime(n))=vecprod(select(n->znorder(Mod(n, p))==p-1, [2..p-1]))
apply(p->a(0, p), primes(20)) \\ Charles R Greathouse IV, May 15 2015
(Perl) use ntheory ":all"; sub list { my $n=shift; grep { znorder($_, $n) == $n-1 } 2..$n-1; } say vecprod(list($_)) for @{primes(nth_prime(20))}; # Dana Jacobsen, May 15 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
T. D. Noe, Sep 27 2006
STATUS
approved