OFFSET
0,3
COMMENTS
The sequence is a permutation of the nonnegative integers A001477.
EXAMPLE
After [0,1,2,3,4,5,6,7,8,9,10] the next term must start with [0+1 = 1]; as 1 and 10 are already in the sequence, “11”, the smallest available integer, is chosen. The next term must start with [1+1 = 2]; as 2 is already in the sequence, “20” is chosen. The next term must start with [0+1 = 1]; as 1, 10 and 11 are already in the sequence, “12” is chosen. Etc.
MATHEMATICA
a[1]=0; a[n_]:=a[n]=Block[{k=1}, While[MemberQ[s=Array[a, n-1], k]||(g=1+Mod[a[n-1], 10]; FromDigits[IntegerDigits[k][[;; IntegerLength@g]]]!=g), k++]; k]; Array[a, 116] (* Giorgos Kalogeropoulos, May 13 2022 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini, Jul 27 2016
STATUS
approved