login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A211487
Characteristic sequence of numbers n having a primitive root modulo n.
6
0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0
OFFSET
1
COMMENTS
a(1) = 0, since we have an empty set of numbers more than 0 and less than 1.
If A(x) is the counting function of a(n)=1, n<=x, then A(x)~2*x/log(x) as x tends to infinity.
Characteristic function of A033948 (apart from the initial term). - Antti Karttunen, Aug 22 2017
FORMULA
a(n) = 1 iff n = 2, 4, p^k, 2*p^k, where p is an odd prime.
A001783(n) ≡ (-1)^a(n) mod n.
From Antti Karttunen, Aug 22 2017: (Start)
For n > 1, if A034380(n) = 1, a(n) = 1, otherwise a(n) = 0.
A103131(n) = (-1)^a(n) for n > 2.
(End)
PROG
(PARI) A211487(n) = if(n%2, !!isprimepower(n), (n==2 || n==4 || (isprimepower(n/2, &n) && n>2))); \\ Antti Karttunen, Aug 22 2017, after Charles R Greathouse IV's code for A033948.
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, May 13 2012
EXTENSIONS
More terms from Antti Karttunen, Aug 22 2017
STATUS
approved