login
A375305
Terms as well as digits fit the even/even/odd pattern; this is the lexicographically earliest injective sequence with this property.
2
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,2
LINKS
EXAMPLE
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.
PROG
(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
CROSSREFS
Sequence in context: A367286 A193902 A043302 * A343964 A345135 A291057
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Aug 11 2024
STATUS
approved