OFFSET
1,1
COMMENTS
The fraction f = n/(10^L-1), where L is the number of decimal digits of n, has the infinite decimal expansion 0.{n}{n}{n}... (with special cases n = 9, 99 etc., where f = 0.999... = 1). This sequence lists the index of this fraction, for given n, corresponding to the "canonical enumeration of positive fractions <= 1", i.e., m such that f = A038566(m) / A038567(m-1).
Inspired by Angelini's blog post, which however takes a different approach to encoding fractions (in a more "decimal" way) and to deal with n's made of digits 9 or with repetitions, such as 11, 111, or 1010, etc.
LINKS
Eric Angelini, Cantorisation, personal blog CinquanteSignes.blogspot.com, Oct 17 2021
FORMULA
EXAMPLE
a(n = 1) = 23 because A038566(23)/A038567(22) = 1/9, the unique fraction (in lowest terms) whose decimal expansion is 0.111..., i.e., period = (1), repeated.
a(n = 2) = 24 because A038566(24)/A038567(23) = 2/9, the unique fraction (in lowest terms) whose decimal expansion is 0.222..., i.e., period = (2), repeated.
a(n = 3) = 3 because A038566(3)/A038567(2) = 1/3, the unique fraction (in lowest terms) whose decimal expansion is 0.333..., i.e., period = (3), repeated.
a(n = 9) = 1 because A038566(1)/A038567(0) = 1/1, the unique fraction (in lowest terms) equal to 0.999..., i.e., period = (9), repeated.
a(n = 10) = 2951 because A038566(2951)/A038567(2950) = 10/99, the unique fraction (in lowest terms) whose decimal expansion is 0.1010..., i.e., period = (10), repeated.
a(11) = a(1) because the unique fraction that has decimal expansion 0.1111..., i.e., period (11) repeated, is 1/9, the same as for 0.111..., i.e., period (1), repeated.
PROG
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Oct 18 2021
STATUS
approved