A375305 Terms as well as digits fit the even/even/odd pattern; this is the lexicographically earliest injective sequence with this property.
0, 2, 1, 4, 6, 3, 8, 210, 21, 20, 10, 23, 22, 12, 25, 24, 14, 27, 26, 16, 29, 28, 18, 41, 40, 30, 43, 42, 32, 45, 44, 34, 47, 46, 36, 49, 48, 38, 61, 60, 50, 63, 62, 52, 65, 64, 54, 67, 66, 56, 69, 68, 58, 81, 80, 70, 83, 82, 72, 85, 84, 74, 87, 86, 76, 89, 88, 78, 21001, 2010, 212, 21003, 2012, 214, 21005
Offset: 1
Examples
a(7) = 8, a(8) = 210, a(9) = 21; the three terms follow the even/even/odd pattern and so do their digits: 8/2/1 and 0/2/1.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Python
from itertools import count, islice, repeat def c(s, i): return all(int(d)%2 == int((i+j)%3 == 2) for j, d in enumerate(s)) def agen(): # generator of terms seen, s = set(), 0 for n in count(0): eo = int(n%3 == 2) an = next(k for k in count(eo, 2) if k not in seen and c(str(k), s)) yield an seen.add(an) s += len(str(an)) print(list(islice(agen(), 99))) # Michael S. Branicky, Aug 11 2024