cp's OEIS Frontend

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.

A020915 Number of digits in base-3 representation of 2^n.

This page as a plain text file.
%I A020915 #60 Jul 02 2025 16:01:55
%S A020915 1,1,2,2,3,4,4,5,6,6,7,7,8,9,9,10,11,11,12,12,13,14,14,15,16,16,17,18,
%T A020915 18,19,19,20,21,21,22,23,23,24,24,25,26,26,27,28,28,29,30,30,31,31,32,
%U A020915 33,33,34,35,35,36,36,37,38,38,39,40,40,41,42,42,43,43,44,45,45,46,47
%N A020915 Number of digits in base-3 representation of 2^n.
%C A020915 For n > 0, first differences of A022331. - _Michel Marcus_, Oct 03 2013
%H A020915 William A. Tedeschi, <a href="/A020915/b020915.txt">Table of n, a(n) for n = 0..10000</a>
%H A020915 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 A020915 a(n) = 1 + floor(n*log_3(2)) = 1 + floor(n*A102525) = 1 + A136409(n). - _R. J. Mathar_, May 23 2009
%F A020915 a(n) = A081604(A000079(n)). - _Reinhard Zumkeller_, Jul 12 2011
%F A020915 a(A020914(n)) = n + 1. - _Reinhard Zumkeller_, Mar 28 2015
%t A020915 Table[Length[IntegerDigits[2^n,3]],{n,0,80}] (* _Harvey P. Dale_, May 02 2012 *)
%t A020915 Table[1 + Floor[n*Log[3, 2]], {n, 0, 73}] (* _L. Edson Jeffery_, Dec 04 2015 *)
%t A020915 IntegerLength[2^Range[0,80],3] (* _Harvey P. Dale_, Nov 17 2022 *)
%o A020915 (Haskell)
%o A020915 a020915 = a081604 . a000079  -- _Reinhard Zumkeller_, Mar 28 2015
%o A020915 (PARI) a(n)=logint(2^n,3)+1 \\ _Charles R Greathouse IV_, Sep 02 2015
%o A020915 (Magma) [Round(1+Floor(n*(Log(2))/Log(3))): n in [0..80]]; // _Vincenzo Librandi_, Dec 05 2015
%Y A020915 Cf. A007089, A020914, A076227, A081604, A000079.
%Y A020915 Cf. A022331, A102525, A136409.
%Y A020915 Cf. A022924 (first differences).
%K A020915 nonn,base,easy,nice
%O A020915 0,3
%A A020915 _Clark Kimberling_
%E A020915 More terms from _James Sellers_