login
List run lengths of digits different from '4', when all terms are concatenated. Lexicographically first such sequence of nonnegative numbers with no repeated terms.
2

%I #10 Jan 02 2023 12:30:51

%S 1,4,0,2,3,5,44,6,7,40,8,9,41,10,11,42,12,13,15,16,17,18,19,20,21,22,

%T 23,25,26,27,28,29,30,31,32,33,35,14,36,37,38,43,39,50,51,45,52,53,55,

%U 56,57,58,59,60,61,62,63,65,66,67,68,69,70,71,72,24,73,75,76,77,46,78,79,80,81,47,82

%N List run lengths of digits different from '4', when all terms are concatenated. Lexicographically first such sequence of nonnegative numbers with no repeated terms.

%C See A261161 - A261163 for comments and examples.

%H E. Angelini, <a href="http://list.seqfan.eu/oldermail/seqfan/2015-August/015191.html">To reach the next "1"</a>, SeqFan list, August 10, 2015.

%o (PARI) A261164(n=99,d=4,a=1,p=0,u=[-1],r=u)={for(n=2,n, print1(a","); p+=#digits(a)+!a; r=concat(r,r[#r]+a+1); while(#r>1&&r[1]<p,r=r[2..-1]); u=setunion(u,[a]);while(#u>1&&u[2]==u[1]+1,u=u[2..-1]); for(k=u[1]+1,9e9,setsearch(u,k)&&next; if(r[1] >= p+#dk=if(k,digits(k),[0]), setsearch(Set(dk),d)&&next, for(i=1,#dk,(dk[i]==d)==!setsearch(r,p+i-1)&&next(2))); a=k;next(2));error);a}

%Y Cf. A261160 - A261169 for the variants that use digit '0', ..., '9' as delimiter.

%K nonn,base

%O 1,2

%A _Eric Angelini_ and _M. F. Hasler_, Aug 10 2015