%I #126 Oct 09 2024 21:24:20
%S 1,2,4,5,7,8,10,12,13,15,16,18,20,21,23,24,26,27,29,31,32,34,35,37,39,
%T 40,42,43,45,46,48,50,51,53,54,56,58,59,61,62,64,65,67,69,70,72,73,75,
%U 77,78,80,81,83,85,86,88,89,91,92,94,96,97,99,100,102,104,105,107
%N Number of digits in the base-2 representation of 3^n.
%C Also, numbers k such that the first digit in the ternary expansion of 2^k is 1. - Mohammed Bouayoun (Mohammed.bouayoun(AT)sanef.com), Apr 24 2006
%C a(n) is the smallest integer such that n/a(n) < log_2(3). - Trevor G. Hyde (thyde12(AT)amherst.edu), Jul 31 2008
%C This sequence represents allowable values of the "dropping time" in the Collatz (3x+1) problem when iterated according to the function f(n) := n/2 if n is even, (3n+1)/2 otherwise, as tabulated in A126241. There is one exception, A126241(1), which has been set to zero by convention. - _K. Spage_, Oct 22 2009
%C An integer k is a term of A020914 if and only if floor(k*(1 + log(2)/log(3))) - abs(k-1)*(1 + log(2)/log(3)) - 1 >= 0. - _K. Spage_, Oct 22 2009
%C Also smallest k such that ceiling(2^k / 3^n) = 2. - _Michel Lagneau_, Jan 31 2012
%C For n > 0, first differences of A022330. - _Michel Marcus_, Oct 03 2013
%C Also the number of powers of two less than or equal to 3^n. - _Robert G. Wilson v_, May 25 2014
%C Except for 1, A020914 is the complement of A054414 and therefore these two form a pair of Beatty sequences. - _Robert G. Wilson v_, May 25 2014
%H T. D. Noe, R. J. Mathar, <a href="/A020914/b020914.txt">Table of n, a(n) for n = 0..20000</a>
%H Mike Winkler, <a href="http://mikewinkler.co.nf/collatz_structure_2014.pdf ">On the structure and the behaviour of Collatz 3n + 1 sequences</a>, 2014.
%H Mike Winkler, <a href="http://arxiv.org/abs/1504.00212">New results on the stopping time behaviour of the Collatz 3x + 1 function</a>, arXiv:1504.00212 [math.GM], 2015.
%H Mike Winkler, <a href="https://arxiv.org/abs/1709.03385">The algorithmic structure of the finite stopping time behavior of the 3x + 1 function</a>, arXiv:1709.03385 [math.GM], 2017.
%F a(n) = floor(1 + n*log(3)/log(2)). - _K. Spage_, Oct 22 2009
%F a(0) = 1, a(n+1) = a(n) + A022921(n). - _K. Spage_, Oct 23 2009
%F a(n) = A122437(n-1) - n. - _K. Spage_, Oct 23 2009
%F A098294(n) = a(n) + n for n > 0. - _Mike Winkler_, Dec 31 2010
%F a(n) = A070939(A000244(n)) = length of n-th row in triangle A227048. - _Reinhard Zumkeller_, Jun 30 2013
%F a(n) = 1 + floor(n*log_2(3)) = 1 + A056576(n) = 1 + floor(n*A020857). - _L. Edson Jeffery_, Dec 12 2014
%F A020915(a(n)) = n + 1. - _Reinhard Zumkeller_, Mar 28 2015
%p A020914 :=n->nops(convert(3^n,base,2)):
%p seq(A020914(n),n=0..70); # _Emeric Deutsch_, Apr 30 2006
%p seq(ilog2(3^n)+1, n=0 .. 100); # _Robert Israel_, Dec 12 2014
%t Table[Length[IntegerDigits[3^n, 2]], {n, 0, 100}] (* _Stefan Steinerberger_, Apr 19 2006 *)
%t a[n_] := Floor[ Log2[3^n] + 1]; Array[a, 105, 0] (* _Robert G. Wilson v_, May 25 2014 *)
%o (PARI) for(n=0,100,print1(floor(1+n*log(3)/log(2)),",")) \\ _K. Spage_, Oct 22 2009
%o (PARI) a(n)=exponent(3^n)+1 \\ _Charles R Greathouse IV_, Nov 03 2022
%o (Haskell)
%o a020914 = a070939 . a000244 -- _Reinhard Zumkeller_, Jun 30 2013
%o (Python)
%o def A020914(n): return (3**n).bit_length() # _Chai Wah Wu_, Oct 09 2024
%Y Cf. A056576, A054414, A070939, A000244, A227048, A022330, A022921 (first differences), A126241.
%Y Cf. A020857 (decimal expansion of log_2(3)).
%Y Cf. A020915.
%Y Cf. A204399 (essentially the same).
%K nonn,base,easy
%O 0,2
%A _Clark Kimberling_
%E More terms from _Stefan Steinerberger_, Apr 19 2006