login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A081604 Number of digits in ternary representation of n. 34
1, 1, 1, 2, 2, 2, 2, 2, 2, 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, 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, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,4

COMMENTS

a(n) is the length of row n in table A054635. - Reinhard Zumkeller, Sep 05 2014

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 0..10000

Eric Weisstein's World of Mathematics, Ternary.

FORMULA

a(n) = A062153(n) + 1 for n >= 1.

a(n) = A077267(n) + A062756(n) + A081603(n);

From Reinhard Zumkeller, Oct 19 2007: (Start)

0 <= A134021(n) - a(n) <= 1;

a(A134025(n)) = A134021(A134025(n));

a(A134026(n)) = A134021(A134026(n)) - 1. (End)

a(n+1) = -Sum_{k=1..n} mu(3*k)*floor(n/k). - Benoit Cloitre, Oct 21 2009

a(n) = floor(log_3(n)) + 1. - Can Atilgan and Murat Er┼čen Berberler, Dec 05 2012

a(n) = if n < 3 then 1 else a(floor(n/3)) + 1. - Reinhard Zumkeller, Sep 05 2014

G.f.: 1 + (1/(1 - x))*Sum_{k>=0} x^(3^k). - Ilya Gutkovskiy, Jan 08 2017

EXAMPLE

a(8) = 2 because 8 = 22_3, having 2 digits.

a(9) = 3 because 9 = 100_3, having 3 digits.

MAPLE

A081604 := proc(n)

    max(1, 1+ilog[3](n)) ;

end proc: # R. J. Mathar, Jul 12 2016

MATHEMATICA

Table[Length[IntegerDigits[n, 3]], {n, 0, 99}] (* Alonso del Arte, Dec 30 2012 *)

Join[{1}, IntegerLength[Range[120], 3]] (* Harvey P. Dale, Apr 07 2019 *)

PROG

(Haskell)

a081604 n = if n < 3 then 1 else a081604 (div n 3) + 1

-- Reinhard Zumkeller, Sep 05 2014, Feb 21 2013

CROSSREFS

Cf. A003137, A007089, A030341, A049803, A054635, A062153, A070939, A080342.

Cf. A062756, A077267, A081603.

Cf. A134021, A134025, A134026, A246435.

Sequence in context: A182434 A185679 A080342 * A123119 A099396 A126235

Adjacent sequences:  A081601 A081602 A081603 * A081605 A081606 A081607

KEYWORD

nonn,base

AUTHOR

Reinhard Zumkeller, Mar 23 2003

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 28 11:08 EST 2020. Contains 332323 sequences. (Running on oeis4.)