OFFSET
1,1
COMMENTS
This is the binary representation of the terms in A033015.
The sequence can be seen as a table where row r contains the terms with r digits. Then row r+1 is obtained by from the terms of row r by duplicating their last digit, and from those of row r-1 by appending twice the 1's complement of their last digit. This yields the row lengths given in FORMULA.
FORMULA
EXAMPLE
There can't be a terms with only 1 digit, so the smallest term is a(1) = 11.
The only 3-digit term is a(2) = 111, since in 100 the digit 1 is alone, and in 101 and 110 the digit 0 is alone.
With four digits we must have either no or two digits 0 and they must be at the end (to avoid isolated '1's), i.e., a(3) = 1100 and a(4) = 1111.
PROG
concat(apply( {A355280_row(n)=if(n>2, setunion([x*10+x%10|x<-A355280_row(n-1)], [x*100+11*(1-x%10)|x<-A355280_row(n-2)]), n>1, [11], [])}, [1..8])) \\ "Row" of n-digit terms. For (very) large n one should implement memoization instead of this naive recursion.
(Python)
def A355280_row(n): return [] if n<2 else [11] if n==2 else sorted(
[x*10+x%10 for x in A355280_row(n-1)] +
[x*100+11-x%10*11 for x in A355280_row(n-2)]) # M. F. Hasler, Oct 17 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
M. F. Hasler, Oct 17 2022
STATUS
approved