A297031 Number of pieces in the list d(m), d(m-1), ..., d(0) of base-3 digits of n; see Comments.
0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 2, 1, 2, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 2, 2, 2, 3, 2, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 2, 2, 1, 2, 3, 3, 4, 4, 3
Offset: 1
Examples
Base-3 digits for 123: 1, 1, 1, 2, 0, so that a(123) = 3.
Links
- Clark Kimberling, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
a[n_, b_] := Length[Map[Length, Split[Sign[Differences[IntegerDigits[n, b]]]]]]; b = 3; Table[a[n, b], {n, 1, 120}]
Comments