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.

A190592 Maximal digit in base-3 expansion of n.

Original entry on oeis.org

0, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
Offset: 0

Views

Author

N. J. A. Sloane, May 13 2011, based on a suggestion from Marc LeBrun

Keywords

Crossrefs

Programs

  • Maple
    [seq(max(convert(n,base,3)),n=0..120)];
  • Mathematica
    Join[{0}, gl[n_] := Module[{idn = IntegerDigits[n, 3]}, Max[idn]]; Array[gl,100]] (* Vincenzo Librandi, Aug 12 2017 *)
  • PARI
    a(n) = if (n==0, 0, vecmax(digits(n, 3))); \\ Michel Marcus, Aug 12 2017

Formula

a(n) = 2 if n == 2 (mod 3), a(1)=1, otherwise a(n) = a(floor(n/3)). - Robert Israel, Aug 11 2017
a(n) = A054055(A007089(n)). - Felix Fröhlich, Aug 13 2017