login
a(n) is the n-th digit after the decimal point in the decimal expansion of the natural logarithm of n.
0

%I #9 Jun 18 2026 22:43:44

%S 0,9,8,2,3,9,1,4,7,9,9,8,5,5,0,2,8,2,0,3,0,1,5,1,6,6,0,3,6,6,3,8,5,1,

%T 6,5,9,1,2,1,1,5,1,2,9,2,2,3,7,9,4,6,0,9,1,2,2,3,3,2,6,8,7,9,3,1,2,7,

%U 7,4,0,2,9,6,3,5,0,3,2,2,7,5,3,3,2,5,2,6,5,4,0,4,9,1,1,5,5,4,8

%N a(n) is the n-th digit after the decimal point in the decimal expansion of the natural logarithm of n.

%C For n >= 2, log(n) is transcendental (by the Lindemann-Weierstrass theorem) and hence irrational, so its n-th decimal digit is well-defined; log(1) = 0 gives a(1) = 0.

%F a(n) = floor(10^n * (log(n) - floor(log(n)))) mod 10.

%e log(1) = 0.0000........., so a(1) = 0.

%e log(2) = 0.6931471805..., whose 2nd decimal digit is 9, so a(2) = 9.

%e log(5) = 1.6094379124..., whose decimal digits after the point are 6,0,9,4,3,..., so the 5th is 3 and a(5) = 3.

%o (Python)

%o from decimal import Decimal, getcontext

%o def a(n):

%o if n == 1: return 0

%o getcontext().prec = n + 50

%o return int(str(Decimal(n).ln()).split(".")[1][n-1])

%o print([a(n) for n in range(1, 100)])

%Y Cf. A002162 (log 2), A002391 (log 3), A016627 (log 4), A016628 (log 5), A016629 (log 6), A016630 (log 7), A016631 (log 8), A016632 (log 9), A002392 (log 10).

%K nonn,base,easy

%O 1,2

%A _Nayanesh Reddy Galiveeti_, Jun 07 2026