A008952 Leading digit of 2^n.
1, 2, 4, 8, 1, 3, 6, 1, 2, 5, 1, 2, 4, 8, 1, 3, 6, 1, 2, 5, 1, 2, 4, 8, 1, 3, 6, 1, 2, 5, 1, 2, 4, 8, 1, 3, 6, 1, 2, 5, 1, 2, 4, 8, 1, 3, 7, 1, 2, 5, 1, 2, 4, 9, 1, 3, 7, 1, 2, 5, 1, 2, 4, 9, 1, 3, 7, 1, 2, 5, 1, 2, 4, 9, 1, 3, 7, 1, 3, 6, 1, 2, 4, 9, 1, 3, 7, 1, 3, 6, 1, 2, 4, 9, 1, 3
Offset: 0
Links
- Robert G. Wilson v, Table of n, a(n) for n = 0..100000.
- Brady Haran and Dmitry Kleinbock, Powers of 2, Numberphile video (2015). More footage.
- Jaap Spies, A Bit of Math, The Art of Problem Solving, Jaap Spies Publishers (2019).
- Wikipedia, Benford's law.
- Wikipedia, Zipf's law.
- Index entries for sequences related to Benford's law
Programs
-
Maple
a:= n-> parse(""||(2^n)[1]): seq(a(n), n=0..100); # Alois P. Heinz, Aug 06 2021
-
Mathematica
a[n_] := First@ IntegerDigits[2^n]; Array[a, 105, 0] (* Robert G. Wilson v, Feb 03 2008 and corrected Nov 24 2014 *)
-
PARI
a(n)=digits(2^n)[1] \\ Charles R Greathouse IV, Oct 11 2015
-
Python
def A008952(n): return int(str(1<
Chai Wah Wu, Jul 07 2022
Formula
a(n) = [2^n / 10^([log_10(2^n)])] = [2^n / 10^([n*log_10(2)])].
Comments