A067497 Smallest k for which 2^k is n+1 decimal digits long, and equivalently numbers k such that 1 is the first digit of 2^k.
0, 4, 7, 10, 14, 17, 20, 24, 27, 30, 34, 37, 40, 44, 47, 50, 54, 57, 60, 64, 67, 70, 74, 77, 80, 84, 87, 90, 94, 97, 100, 103, 107, 110, 113, 117, 120, 123, 127, 130, 133, 137, 140, 143, 147, 150, 153, 157, 160, 163, 167, 170, 173, 177, 180, 183, 187, 190, 193, 196
Offset: 0
Links
- Muniru A Asiru, Table of n, a(n) for n = 0..5000
Programs
-
GAP
Filtered([0..200],n->ListOfDigits(2^n)[1]=1); # Muniru A Asiru, Oct 22 2018
-
Mathematica
a[n_] := Block[{k = 0}, While[ Floor[Log[10, 2^k] + 1] < n, k++ ]; k]; Table[ a[n], {n, 1, 61}] Table[Ceiling[n*Log[2, 10]], {n, 0, 59}] (* Jean-François Alcover, Jan 29 2014, after Vladeta Jovovic *)
-
PARI
for(n=0,500, if(floor(2^n/10^(floor(n*log(2)/log(10))))==1,print1(n,", ")))
-
PARI
a(n) = ceil(n*log(10)/log(2)); \\ Michel Marcus, May 13 2017
-
Python
def A067497(n): return (10**n-1).bit_length() # Chai Wah Wu, Apr 02 2023
-
Sage
[ceil(n*log(10)/log(2)) for n in range(0, 60)] # Stefano Spezia, Aug 31 2024
Formula
a(n) = ceiling(n*log_2(10)). - Vladeta Jovovic, Jun 20 2002
a(n) = log_2(A067488(n+1)). - Charles L. Hohn, Jun 09 2024
Extensions
Additional comments from Lekraj Beedassy, Jun 20 2002 and from Rick Shephard, Jun 27 2002
Comments