%I #22 Jan 14 2021 21:17:18
%S 0,1,2,222,22,2222,3,120,10,234,24,103,112,122,100,2345,25,1130,102,
%T 1345,111,2340,1000,111213,11,112340,13,111240,124,11350,1012,13456,
%U 1111,23450,1167,11230,10134,11215,10003,1112456,245,1011236,1004,10235678,235,1114670,1002,11134567,113
%N a(n) is the smallest number not occurring earlier whose concatenation with the previous term contains the smallest possible number of numeric substrings strictly larger than for the preceding term; a(0) = 0.
%C "Numeric substrings" means that leading zeros are ignored: e.g., 1003 contains six distinct numeric substrings {0, 1, 3, 10, 100, 1003}. The duplicate "0" is not counted twice, and "03" and "003" are not considered (or identified with 3).
%C We write N(1003) = 6 for the number of substring numbers contained in 1003.
%C Let m(n+1) := min { N(a(n).k); k in N \ a({0..n}) }, where "." means concatenation.
%C Then a(n+1) := min { k in N \ a({0..n}): N(a(n).k) = m(n+1) }.
%C The sequence m(n) makes jumps larger than one at indices 6, 20, 24, 32, 44, 48, 50, ... The jumps are +3 at indices 6 and 48, and +2 at the other indices listed here.
%C An independent verification of the given terms would be appreciated. - _M. F. Hasler_, May 13 2019
%H M. F. Hasler, <a href="/A307511/b307511.txt">Table of n, a(n) for n = 0..64</a> (a(53..64) from _Carole Dubois_).
%H M. F. Hasler, <a href="/wiki/User:M._F._Hasler/A307511#C.2B.2B">C++ program for A307511</a>, OEIS wiki. May 13, 2019.
%e a(0) = 0 by convention. (One could also start with a(1) = 1.)
%e Then the smallest distinct integer we can concatenate is a(1) = 1, and the concatenation with a(0) yields N("01") = #{0, 1} = 2 distinct numeric substrings.
%e Then we cannot reuse 1, and whether we concatenate 2 or 11, both yield 3 numeric substrings: N("12") = #{1, 2, 12} = 3, N("111") = #{1, 11, 111} = 3. Therefore, a(2) = 2.
%e Then, appending a (different) single-digit number would yield again 3 substrings, we need to append a two- or three-digit number. Appending 10 would yield N("210") = #{0, 1, 2, 10, 21, 210} = 6, appending 21 would yield N("221") = #{1, 2, 21, 22, 221} = 5 substring numbers, but appending 222 yields N("2222") = #{2, 22, 222, 2222} = 4: This m(3) = 4 is the smallest possible number of substring numbers strictly larger than the preceding m(2) = 3. Therefore a(3) = 222.
%o (PARI) A307511_vec(N=99, show=1, a=1, U=Set(a), terms=[])={ type(a)!="t_LIST" && a=List(a); my(n(s)=#Set(concat(vector(logint(s,10)+1,k,vector(k,i,if(i>1,k\=10,k=s%10^k)))))); while(#a<N, my( an=a[#a], L=n(if(#a>1,a[#a-1]*10^(logint(an,10)+1))+an)+1, K=1, m, nn); U=setunion(U,[an=a[#a]]); show && print1(an","); if( terms&&terms[1][1]==#a+1, listput(a,terms[nn][2]); terms=terms[^1]; next); while(K*=10,m=99; for(k=K\10,K-1, if(setsearch(U,k),, L == nn=n(an*K+k), listput(a,k); next(3), nn<m, m=nn)); if(m>L && (!setsearch(U,K\9*(an%10)) || n(K\9*(an%10)+an*K)>L), L++; K=1))); Vec(a)}
%o (C++) see LINKS section.
%K nonn,base
%O 0,3
%A _Eric Angelini_ and _M. F. Hasler_, Apr 12 2019
%E a(53..64) computed by _Carole Dubois_, May 13 2019