

A062153


a(n) = floor(log_3(n)).


25



0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,9


LINKS

Harry J. Smith, Table of n, a(n) for n = 1..1000


FORMULA

a(n) = (number of digits of n when written in base 3)  1.
a(n) = if n > 2 then a(floor(n / 3)) + 1 else 0.  Reinhard Zumkeller, Oct 29 2001
G.f.: (1/(1  x))*Sum_{k>=1} x^(3^k).  Ilya Gutkovskiy, Jan 08 2017


MATHEMATICA

Floor[Log[3, Range[120]]] (* Harvey P. Dale, Apr 30 2011 *)


PROG

(MAGMA) [ Ilog(3, n) : n in [1..100] ]; // N. J. A. Sloane, Dec 23 2006
(PARI) { default(realprecision, 100); t=1/log(3); for (n=1, 1000, write("b062153.txt", n, " ", floor(t*log(n) + 0.0000001)) ) } \\ Harry J. Smith, Aug 02 2009


CROSSREFS

Cf. A000244, A000523, A007089, A102572.
Sequence in context: A214081 A194338 A176170 * A217693 A204560 A135661
Adjacent sequences: A062150 A062151 A062152 * A062154 A062155 A062156


KEYWORD

easy,nonn


AUTHOR

Henry Bottomley, Jun 06 2001


STATUS

approved



