OFFSET
0,5
COMMENTS
The sequence consists of the positive integers, each appearing 3 or 4 times. - M. F. Hasler, Oct 08 2016
LINKS
T. D. Noe, Table of n, a(n) for n = 0..10000
Eric Weisstein's World of Mathematics, Mersenne Number
FORMULA
a(n) = floor(n*log_10(2)) + 1. E.g., a(10)=4 because 2^10 = 1024 and floor(10*log_10(2)) + 1 = 3 + 1 = 4. - Jaap Spies, Dec 11 2003
MAPLE
seq(floor(n*ln(2)/ln(10))+1, n=0..100); # Jaap Spies, Dec 11 2003
MATHEMATICA
Table[Length[IntegerDigits[2^n]], {n, 0, 100}] (* T. D. Noe, Feb 11 2013 *)
IntegerLength[2^Range[0, 80]] (* Harvey P. Dale, Jul 28 2017 *)
PROG
(Magma) [#Intseq(2^n): n in [0..100] ]; // Vincenzo Librandi, Jun 23 2015
(PARI) A034887(n)=n*log(2)\log(10)+1 \\ or: { a(n)=#digits(1<<n) }. - M. F. Hasler, Oct 08 2016
(Python)
def a(n): return len(str(1 << n))
print([a(n) for n in range(73)]) # Michael S. Branicky, Dec 23 2022
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved