login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A062153 a(n) = floor(log_3(n)). 28
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
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
(PARI) a(n)=logint(n, 3) \\ Charles R Greathouse IV, Nov 15 2022
CROSSREFS
Sequence in context: A214081 A194338 A176170 * A217693 A204560 A135661
KEYWORD
easy,nonn
AUTHOR
Henry Bottomley, Jun 06 2001
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 05:28 EDT 2024. Contains 371264 sequences. (Running on oeis4.)