Rightmost digit — and even digits to its right
The rightmost digit d of a(n) says: "There are exactly d even digits immediately after me". This should be the lexicographically earliest sequence S of distinct nonnegative numbers with this property. And you know what? S was a nightmare to compute by hand! But, as we love Füssli , S was also an immense pleasure to explore! S = 0, 1, 21, 23, 2, 20, 3, 200, 5, 4, 22, 40, 7, 6, 24, 42, 60, 9, 8, 26, 44, 62, 80, 10, 11, 25, 202, 201, 27, 204, 2000, 12, 203, 220, 13, 2001, 29, 226, 64, 82, 205, 222, 207, 224, 20001, 41, 43, 240, 14, 20003, 260, 15, 242, 209, 246, 84, 20005 , 262 , 221, 45, 282 , 223, 280, 16, 2002, 225, 402, 227, 244, 20007, 264, 20009, 266, 2022, 229, 286, 2042, 241, 47, 284, 20021, ... Explanation S = 0 , 1 , 2 1 , 2 3 , 2 , 2 0 , 3 , 20 0 , 5 , 4 , 22, 40 , 7, 6, 24, 42, 60, 9, 8, ... (in blue above, the rightmost digit; underlined are the even digits that come after a blue digit) a(1) = 0, ending in 0, and there is no even digit after