OFFSET
1,4
COMMENTS
If n is a prime p, a(n) == -1 (mod p) for n > 3; if n is a composite c, a(n) == 0 (mod c) for n > 4.
EXAMPLE
a(11) = 5400 because the primitive roots of 11 are {2,6,7,8} and therefore the nonprimitive roots of 11 are {1,3,4,5,9,10} and 1*3*4*5*9*10 = 5400.
MATHEMATICA
a[n_] := If[n == 2 || (p = PrimitiveRootList[n]) == {}, 0, (n - 1)!/Times @@ p]; Array[a, 30] (* Amiram Eldar, Sep 26 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Davide Rotondo, Sep 26 2021
STATUS
approved