OFFSET
1,2
COMMENTS
Equivalently a(n) is the number of positive integers less than or equal to n that are 1,2,4 or of the form p^i or 2*p^i where p is an odd prime.
a(10^k) for k=1,2,...,7: 9, 50, 293, 1969, 14889, 120424, 1014032.
LINKS
Eric Weisstein's World of Mathematics, Primitive Root
FORMULA
a(n) ~ 3/2 * n/log(n). - Vaclav Kotesovec, Dec 20 2014
EXAMPLE
a(12)=10 because there are 10 positive integers that are less than or equal to 12 that have a primitive root:1,2,3,4,5,6,7,9,10,11.
MATHEMATICA
Table[Length[Select[Range[2, n], IntegerQ[PrimitiveRoot[#]] &]] +
1, {n, 1, 100}]
Accumulate[Table[If[Length[PrimitiveRootList[n]]>0, 1, 0], {n, 100}]]+1 (* Harvey P. Dale, Jul 19 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Geoffrey Critzer, Dec 19 2014
STATUS
approved