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.

A246435 Length of representation of n in fractional base 3/2.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9
Offset: 0

Views

Author

Reinhard Zumkeller, Sep 05 2014

Keywords

Crossrefs

Cf. A024629, A055642, A070989, A081604, A081848 (run lengths), A244040.

Programs

  • Haskell
    a246435 n = if n < 3 then 1 else a246435 (2 * div n 3) + 1
    -- Reinhard Zumkeller, Sep 05 2014
    
  • Mathematica
    a[n_] := If[n < 3, 1, a[2 Quotient[n, 3]] + 1]; Array[a, 100, 0] (* Jean-François Alcover, Feb 05 2019 *)
  • PARI
    a(n) = if(n < 3, 1, a(n\3 * 2) + 1); \\ Amiram Eldar, Jul 30 2025

Formula

a(n) = if n < 3 then 1, otherwise a(2*floor(n/3)) + 1.
a(n) = A055642(A024629(n)).