OFFSET
0,3
COMMENTS
The modified ternary sequence, (1,2,3,9,27,81,...) consists of 2 together with all 3^k for k>=0.
EXAMPLE
8 = 2*3 + 1*2 + 0*1, so that 8 in the modified ternary base is 210.
MATHEMATICA
greedy[list_, n_] := Reap[FoldList[(Sow[Quotient[#1, #2]]; Mod[#1, #2]) &, n, Reverse[list]]][[2, 1]];
seq = Insert[Table[3^n, {n, 0, 5}], 2, 2]; (*1, 2, 3, 9, 27, ...*)
Table[FromDigits[greedy[seq, n]], {n, Last[seq]}]
(* Peter J. C. Moses, Oct 18 2012; from A214973 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Clark Kimberling, Sep 28 2024
STATUS
approved