A172506 a(n) = numerator of fraction a/b, where gcd(a, b) = 1, whose decimal representation has the form (1)(2)(3)...(n-1)(n).(1)(2)(3)...(n-1)(n).
11, 303, 123123, 6170617, 246902469, 1929001929, 12345671234567, 617283906172839, 123456789123456789, 123456789101234567891, 12345678910111234567891011, 15432098637639015432098637639, 1234567891011121312345678910111213, 6172839455055606570617283945505560657
Offset: 1
Examples
a(6) = 1929001929; 1929001929/15625 = 123456.123456.
Programs
-
Python
from itertools import count, islice def agen(): # generator of terms k, den, pow = 0, 1, 0 for n in count(1): sn = str(n) k = k*10**len(sn) + n den *= 10**len(sn) pow += len(sn) nr, c2, c5 = k*(den+1), pow, pow while nr%2 == 0 and c2 > 0: nr //= 2; c2 -= 1 while nr%5 == 0 and c5 > 0: nr //= 5; c5 -= 1 yield nr print(list(islice(agen(), 19))) # Michael S. Branicky, Nov 30 2022
Extensions
a(9) and beyond from Michael S. Branicky, Nov 30 2022
Comments