OFFSET
0,4
COMMENTS
The value 0 at index 0 says 0 has no primitive roots, but the 0 at index 1 says 1 has a primitive root of 0, the only real 0 in the sequence. - Initial terms corrected by Harry J. Smith, Jan 27 2005
a(n) is nonzero if and only if n is 2, 4, or of the form p^k, or 2*p^k where p is an odd prime and k>0. - Tom Edgar, Jun 02 2014
LINKS
T. D. Noe, Table of n, a(n) for n = 0..10000
Eric Weisstein's World of Mathematics, Primitive Root.
MATHEMATICA
f[n_] := Block[{pr = PrimitiveRootList[n]}, If[pr == {}, 0, pr[[-1]]]]; Array[f, 86, 0] (* Robert G. Wilson v, Nov 03 2014 *)
PROG
(PARI) for(i=0, 100, p=0; for(q=1, i-1, if(gcd(q, i)==1&&znorder(Mod(q, i))==eulerphi(i), p=q)); print1(p", ")) /* V. Raman, Nov 22 2012 */
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Initial terms corrected by Harry J. Smith, Jan 27 2005
STATUS
approved