%I #15 Jan 07 2022 15:33:53
%S 1,10,11,100,1101,10001,11010,100010,110099991,1000100001,1100999910,
%T 10001000010,110099990992,100010000100,11009999099191,100010000099992,
%U 1100999909919097,10001000009999195,110099990991909693,1000100000999919493,11009999099190969296
%N Lexicographically earliest sequence S of distinct positive terms such that the first n digits of a(n)*a(n+1) are the first n digits of S.
%C A self-describing sequence.
%H Michael S. Branicky, <a href="/A348109/b348109.txt">Table of n, a(n) for n = 1..1001</a>
%e a(1)*a(2) = 1*10 = 10 and 1 is the 1st digit of the product and S;
%e a(2)*a(3) = 10*11 = 110 and 1, 1 are the first 2 digits of the product and S;
%e a(3)*a(4) = 11*100 = 1100 and 1, 1, 0 are the first 3 digits of the product and S;
%e a(4)*a(5) = 100*1101 = 110100 and 1, 1, 0, 1 are the first 4 digits of the product and S;
%e a(5)*a(6) = 1101*10001 = 11011101 and 1, 1, 0, 1, 1 are the first 5 digits of the product and S;
%e a(6)*a(7) = 10001*11010 = 110111010 and 1, 1, 0, 1, 1, 1 are the first 6 digits of the product and S; etc.
%o (Python)
%o def aupton(terms):
%o alst, astr, n = [1], "1", 1
%o while len(alst) < terms:
%o an, n = alst[-1], len(alst)
%o target, pow10 = int(astr[:n]), 1
%o while len(alst) == n:
%o i = 0
%o while i < pow10:
%o q, r = divmod(target+i, an)
%o if r == 0 and q not in alst:
%o alst.append(q)
%o astr += str(q)
%o break
%o i += an - r
%o pow10 *= 10
%o target *= 10
%o return alst
%o print(aupton(21)) # _Michael S. Branicky_, Jan 07 2022
%Y Cf. A348108.
%K base,nonn
%O 1,2
%A _Eric Angelini_ and _Carole Dubois_, Sep 30 2021
%E a(15) and beyond from _Michael S. Branicky_, Jan 07 2022
|