OFFSET
0,2
COMMENTS
Sums of lengths of ternary numbers (A007089).
LINKS
Eric Weisstein's World of Mathematics, Ternary
FORMULA
G.f.: 1/(1 - x) + (1/(1 - x)^2)*Sum_{k>=0} x^(3^k).
a(n) = 1 + Sum_{k=1..n} floor(log_3(k)) + 1.
EXAMPLE
-----------------------
n base 3 length a(n)
-----------------------
0 | 0 | 1 | 1
1 | 1 | 1 | 2
2 | 2 | 1 | 3
3 | 10 | 2 | 5
4 | 11 | 2 | 7
5 | 12 | 2 | 9
6 | 20 | 2 | 11
7 | 21 | 2 | 13
8 | 22 | 2 | 15
9 | 100 | 3 | 18
-----------------------
MATHEMATICA
CoefficientList[Series[1/(1 - x) + (1/(1 - x)^2) Sum[x^3^k, {k, 0, 15}], {x, 0, 70}], x]
Table[1 + Sum[Floor[Log[3, k]] + 1, {k, 1, n}], {n, 0, 70}]
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Ilya Gutkovskiy, Jan 07 2017
STATUS
approved