login
A375306
Terms as well as digits fit the even/odd/odd pattern; this is the lexicographically earliest injective sequence with this property.
2
0, 1, 3, 2, 5, 7, 4, 9, 101, 10, 11, 21, 12, 13, 23, 14, 15, 25, 16, 17, 27, 18, 19, 29, 30, 31, 41, 32, 33, 43, 34, 35, 45, 36, 37, 47, 38, 39, 49, 50, 51, 61, 52, 53, 63, 54, 55, 65, 56, 57, 67, 58, 59, 69, 70, 71, 81, 72, 73, 83, 74, 75, 85, 76, 77, 87, 78, 79, 89, 90, 91, 211, 6, 93, 213, 8, 95, 215, 2110, 97
OFFSET
1,3
LINKS
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
Sequence in context: A249559 A182846 A292962 * A375112 A069196 A222209
KEYWORD
base,nonn
AUTHOR
Eric Angelini, Aug 11 2024
STATUS
approved