OFFSET
1,2
COMMENTS
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.
FORMULA
a(n) = floor(10^n * (log(n) - floor(log(n)))) mod 10.
EXAMPLE
log(1) = 0.0000........., so a(1) = 0.
log(2) = 0.6931471805..., whose 2nd decimal digit is 9, so a(2) = 9.
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.
PROG
(Python)
from decimal import Decimal, getcontext
def a(n):
if n == 1: return 0
getcontext().prec = n + 50
return int(str(Decimal(n).ln()).split(".")[1][n-1])
print([a(n) for n in range(1, 100)])
CROSSREFS
KEYWORD
nonn,base,easy,new
AUTHOR
Nayanesh Reddy Galiveeti, Jun 07 2026
STATUS
approved
