OFFSET
1,2
COMMENTS
The sequence starts with a(1) = 1 and was always extended with the smallest integer not yet used that doesn't lead to a contradiction.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000
EXAMPLE
The pair [1,2] uses only one even digit (2).
The pair [2,3] uses only one even digit (2).
The pair [3,4] uses only one even digit (4).
The pair [4,5] uses only one even digit (4).
The pair [5,6] uses only one even digit (6).
The pair [6,7] uses only one even digit (6).
The pair [7,8] uses only one even digit (8).
The pair [8,9] uses only one even digit (8).
The pair [9,10] uses only one even digit (0).
The pair [10,11] uses only one even digit (0).
The pair [11,12] uses only one even digit (2).
etc.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=Block[{k=1}, While[MemberQ[Array[a, n-1], k]||Length@Select[Flatten[IntegerDigits/@{a[n-1], k}], EvenQ]!=1, k++]; k]; Array[a, 89] (* Giorgos Kalogeropoulos, May 12 2022 *)
PROG
(Python)
from itertools import islice
def one_even(s): return sum(1 for d in s if d in "02468") == 1
def agen(): # generator of terms
an, aset, mink = 1, {1}, 2
while True:
yield an
k, stran = mink, str(an)
while k in aset or not one_even(stran + str(k)): k += 1
an = k
aset.add(an)
while mink in aset: mink += 1
print(list(islice(agen(), 89))) # Michael S. Branicky, May 12 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Eric Angelini, Aug 08 2016
STATUS
approved