|
|
A307511
|
|
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.
|
|
1
|
|
|
0, 1, 2, 222, 22, 2222, 3, 120, 10, 234, 24, 103, 112, 122, 100, 2345, 25, 1130, 102, 1345, 111, 2340, 1000, 111213, 11, 112340, 13, 111240, 124, 11350, 1012, 13456, 1111, 23450, 1167, 11230, 10134, 11215, 10003, 1112456, 245, 1011236, 1004, 10235678, 235, 1114670, 1002, 11134567, 113
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
"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).
We write N(1003) = 6 for the number of substring numbers contained in 1003.
Let m(n+1) := min { N(a(n).k); k in N \ a({0..n}) }, where "." means concatenation.
Then a(n+1) := min { k in N \ a({0..n}): N(a(n).k) = m(n+1) }.
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.
An independent verification of the given terms would be appreciated. - M. F. Hasler, May 13 2019
|
|
LINKS
|
|
|
EXAMPLE
|
a(0) = 0 by convention. (One could also start with a(1) = 1.)
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.
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.
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.
|
|
PROG
|
(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)}
(C++) see LINKS section.
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|