login
A374039
a(n) = 1 if the 3-adic valuation of n is not 1, otherwise 0.
3
1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1
OFFSET
1
COMMENTS
a(n) = 1 if n is either non-multiple of 3 or n is a multiple 9, and 0 otherwise (if the 3-adic valuation of n is 1).
Period 9: repeat [1, 1, 0, 1, 1, 0, 1, 1, 1].
FORMULA
Multiplicative with a(3^e) = 1 if e>1, and 0 if e=1, and for all other primes p, a(p^e) = 1.
a(n) = [A007949(n) != 1], where [ ] is the Iverson bracket.
a(n) = A011655(n) + A267142(n).
From Amiram Eldar, Jun 28 2024: (Start)
Dirichlet g.f.: zeta(s) * (1 - 1/3^s + 1/9^s).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 7/9. (End)
MATHEMATICA
a[n_] := If[IntegerExponent[n, 3] == 1, 0, 1]; Array[a, 100] (* Amiram Eldar, Jun 28 2024 *)
PROG
(PARI) A374039(n) = (1!=valuation(n, 3));
(PARI) A374039(n) = { my(f=factor(n)); prod(i=1, #f~, (3!=f[i, 1] || f[i, 2]!=1)); }
(PARI) A374039(n) = ([1, 1, 1, 0, 1, 1, 0, 1, 1][(n%9)+1]);
CROSSREFS
Characteristic function of A074232.
Sequence in context: A285421 A285431 A267621 * A014114 A014219 A065828
KEYWORD
nonn,mult,easy
AUTHOR
Antti Karttunen, Jun 28 2024
STATUS
approved