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)). 29

%I #24 Nov 15 2022 14:26:06

%S 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,

%T 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,

%U 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

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

%H Harry J. Smith, <a href="/A062153/b062153.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = (number of digits of n when written in base 3) - 1.

%F a(n) = if n > 2 then a(floor(n / 3)) + 1 else 0. - _Reinhard Zumkeller_, Oct 29 2001

%F G.f.: (1/(1 - x))*Sum_{k>=1} x^(3^k). - _Ilya Gutkovskiy_, Jan 08 2017

%t Floor[Log[3,Range[120]]] (* _Harvey P. Dale_, Apr 30 2011 *)

%o (Magma) [ Ilog(3,n) : n in [1..100] ]; // _N. J. A. Sloane_, Dec 23 2006

%o (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

%o (PARI) a(n)=logint(n,3) \\ _Charles R Greathouse IV_, Nov 15 2022

%Y Cf. A000244, A000523, A007089, A102572.

%K easy,nonn

%O 1,9

%A _Henry Bottomley_, Jun 06 2001

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 August 28 23:11 EDT 2024. Contains 375508 sequences. (Running on oeis4.)