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.

A259346 If n = 2^k then a(n) = 3^k, otherwise a(n) = 0.

Original entry on oeis.org

1, 3, 0, 9, 0, 0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 243, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 729, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Views

Author

N. J. A. Sloane, Jun 27 2015

Keywords

Programs

  • Mathematica
    a[n_] := With[{k = IntegerExponent[n, 2]}, If[n == 2^k, 3^k, 0]];
    Array[a, 85] (* Jean-François Alcover, Aug 27 2019 *)
  • PARI
    a(n)={my(e=valuation(n,2)); if(n == 2^e, 3^e, 0)} \\ Andrew Howroyd, Jul 27 2018

Formula

Completely multiplicative with a(2) = 3, a(p) = 0 for odd prime p. - Andrew Howroyd, Jul 27 2018
Dirichlet g.f.: 2^s/(2^s-3). - Amiram Eldar, Sep 14 2023

Extensions

More terms from Jon E. Schoenfield, Jun 28 2015