cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A318666 a(n) = 2^{the 3-adic valuation of n}.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Sep 03 2018

Keywords

Crossrefs

Programs

  • Magma
    [2^Valuation(n, 3): n in [1..100]]; // Vincenzo Librandi, Mar 19 2020
  • Mathematica
    Table[2^IntegerExponent[n, 3], {n, 100}] (* Vincenzo Librandi, Mar 19 2020 *)
  • 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); };
    

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