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.

A027870 Number of zero digits in 2^n.

This page as a plain text file.
%I A027870 #51 Jul 19 2025 00:12:55
%S A027870 0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,0,0,1,1,1,1,0,0,1,0,0,1,1,0,0,0,
%T A027870 0,0,0,0,1,0,1,1,2,3,1,1,1,1,1,0,1,0,2,3,2,2,2,1,1,2,2,3,2,2,2,1,1,0,
%U A027870 1,3,3,1,0,1,1,1,0,0,2,4,2,0,2,3,1,1,0,3,5,3,3,4,2,3,4,1,1,4,5,5,6,6,7,5,5
%N A027870 Number of zero digits in 2^n.
%C A027870 I conjecture that any value x = 0, 1, 2, ... occurs only a finite number of times N(x) = 36, 41, 31, 34, 25, 32, 37, 23, 43, 47, 33, ... in this sequence, for the last time at well defined indices i(x) = 86, 229, 231, 359, 283, 357, 475, 476, 649, 733, 648, ... - _M. F. Hasler_, Jul 09 2025
%H A027870 Alois P. Heinz, <a href="/A027870/b027870.txt">Table of n, a(n) for n = 0..20000</a> (first 1001 terms from _Harry J. Smith_, Oct 27 2009)
%F A027870 a(n) = A055641(A000079(n)). - _Reinhard Zumkeller_, Apr 30 2013
%F A027870 a(A007377(n)) = 0; A224782(n) <= a(n). - _Reinhard Zumkeller_, Apr 30 2013
%e A027870 2^31 = 2147483648 so a(31) = 0 and 2^42 = 4398046511104 so a(42) = 2.
%t A027870 Table[ Count[ IntegerDigits[2^n], 0], {n, 0, 100} ]
%t A027870 DigitCount[2^Range[0,110],10,0] (* _Harvey P. Dale_, Nov 20 2011 *)
%o A027870 (PARI) A027870(n)=#select(d->!d,digits(2^n)) \\ _M. F. Hasler_, Jun 14 2018
%o A027870 (Haskell) a027870 = a055641 . a000079  -- _Reinhard Zumkeller_, Apr 30 2013
%o A027870 (Python)
%o A027870 def A027870(n):
%o A027870     return str(2**n).count('0') # _Chai Wah Wu_, Feb 14 2020
%Y A027870 Cf. A000079 (powers of 2), A007377 (2^n has no zeros).
%Y A027870 Similar for other digits: A065712 (1's), A065710 (2's), A065714 (3's), A065715 (4's), A065716 (5's), A065717 (6's), A065718 (7's), A065719 (8's), A065744 (9's).
%Y A027870 Cf. A031146 (index of first appearance of n in this sequence), A094776 (index of last occurrence of digit n in powers of 2).
%Y A027870 Cf. A305932 (table with n in row a(n)).
%K A027870 nonn,base
%O A027870 0,43
%A A027870 _N. J. A. Sloane_
%E A027870 Edited by _M. F. Hasler_, Jul 09 2025