OFFSET
1,3
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
a(7) = 4, a(8) = 9, a(9) = 101, a(10) = 10; terms follow the even/odd/odd pattern and so do their digits: 4/9/1 and 0/1/1.
PROG
(Python)
from itertools import count, islice, repeat
def c(s, i):
return all(int(d)%2 == int((i+j)%3 > 0) for j, d in enumerate(s))
def agen(): # generator of terms
seen, s = set(), 0
for n in count(0):
eo = int(n%3 > 0)
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
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Aug 11 2024
STATUS
approved