This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A081604 #67 Feb 16 2025 08:32:48 %S A081604 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, %T A081604 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, %U A081604 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 %N A081604 Number of digits in ternary representation of n. %C A081604 a(n) is the length of row n in table A054635. - _Reinhard Zumkeller_, Sep 05 2014 %H A081604 Reinhard Zumkeller, <a href="/A081604/b081604.txt">Table of n, a(n) for n = 0..10000</a> %H A081604 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Ternary.html">Ternary</a>. %F A081604 a(n) = A062153(n) + 1 for n >= 1. %F A081604 a(n) = A077267(n) + A062756(n) + A081603(n); %F A081604 From _Reinhard Zumkeller_, Oct 19 2007: (Start) %F A081604 0 <= A134021(n) - a(n) <= 1; %F A081604 a(A134025(n)) = A134021(A134025(n)); %F A081604 a(A134026(n)) = A134021(A134026(n)) - 1. (End) %F A081604 a(n+1) = -Sum_{k=1..n} mu(3*k)*floor(n/k). - _Benoit Cloitre_, Oct 21 2009 %F A081604 a(n) = floor(log_3(n)) + 1. - _Can Atilgan_ and Murat Erşen Berberler, Dec 05 2012 %F A081604 a(n) = if n < 3 then 1 else a(floor(n/3)) + 1. - _Reinhard Zumkeller_, Sep 05 2014 %F A081604 G.f.: 1 + (1/(1 - x))*Sum_{k>=0} x^(3^k). - _Ilya Gutkovskiy_, Jan 08 2017 %e A081604 a(8) = 2 because 8 = 22_3, having 2 digits. %e A081604 a(9) = 3 because 9 = 100_3, having 3 digits. %p A081604 A081604 := proc(n) %p A081604 max(1,1+ilog[3](n)) ; %p A081604 end proc: # _R. J. Mathar_, Jul 12 2016 %t A081604 Table[Length[IntegerDigits[n, 3]], {n, 0, 99}] (* _Alonso del Arte_, Dec 30 2012 *) %t A081604 Join[{1},IntegerLength[Range[120],3]] (* _Harvey P. Dale_, Apr 07 2019 *) %o A081604 (Haskell) %o A081604 a081604 n = if n < 3 then 1 else a081604 (div n 3) + 1 %o A081604 -- _Reinhard Zumkeller_, Sep 05 2014, Feb 21 2013 %Y A081604 Cf. A003137, A007089, A030341, A049803, A054635, A062153, A070939, A080342. %Y A081604 Cf. A062756, A077267, A081603. %Y A081604 Cf. A134021, A134025, A134026, A246435. %K A081604 nonn,base %O A081604 0,4 %A A081604 _Reinhard Zumkeller_, Mar 23 2003