login
A318666
a(n) = 2^{the 3-adic valuation of n}.
2
1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 8, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 8, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 16, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2, 1, 1, 4, 1, 1, 2, 1, 1, 2
OFFSET
1,3
LINKS
FORMULA
a(n) = 2^A007949(n).
a(n) = A046644(n)/A317932(n).
Multiplicative with a(3^e) = 2^e, a(p^e) = 1 for any other primes.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2. - Amiram Eldar, Nov 17 2022
Dirichlet g.f.: zeta(s)*(3^s-1)/(3^s-2). - Amiram Eldar, Jan 03 2023
More precise asymptotics: Sum_{k=1..n} a(k) ~ 2*n + zeta(log(2)/log(3)) * n^(log(2)/log(3)) / (2*log(2)). - Vaclav Kotesovec, Jun 25 2024
MATHEMATICA
Table[2^IntegerExponent[n, 3], {n, 100}] (* Vincenzo Librandi, Mar 19 2020 *)
PROG
(PARI) A318666(n) = 2^valuation(n, 3);
(PARI) A318666(n) = { my(f = factor(n), m=1); for(i=1, #f~, if(3 == f[i, 1], m *= 2^f[i, 2])); (m); };
(Magma) [2^Valuation(n, 3): n in [1..100]]; // Vincenzo Librandi, Mar 19 2020
CROSSREFS
KEYWORD
nonn,mult
AUTHOR
Antti Karttunen, Sep 03 2018
STATUS
approved