OFFSET
0,2
COMMENTS
The term a(0) = 1 means 01 without the leading zero; no other number is affected by this problem of the leading zero.
Similar to the "Look & Say" operation LS = A045918, in which the count precedes the digit. However, here each distinct digit is considered only once: Thus, while LS(121) = 111211, a(121) = 1221 ("digit 1 twice, digit 2 once").
FORMULA
If n is in A010784 (has only distinct digits), then a(n) = (n with an additional digit 1 inserted after each digit).
EXAMPLE
a(1) = 11 for "digit 1, once".
a(10) = 1101 for "digit 1, once; digit 0, once".
a(11) = 12 for "digit 1, twice".
a(12) = 1121 for "digit 1, once; digit 2, once".
a(100) = 1102 for "digit 1, once; digit 0, twice".a(111) = 13, for "digit 1, three times".
MATHEMATICA
PROG
(PARI) apply( a(n)={eval(concat(vector(#n=digits(n), i, if(!setsearch(Set(n[1..i-1]), n[i]), Str(n[i], #select(d->d==n[i], n)), ""))))}, [1..111])
CROSSREFS
KEYWORD
nonn,base,less
AUTHOR
M. F. Hasler, Dec 09 2019
STATUS
approved