login
A275776
The pair [a(n),a(n+1)] uses only one even digit.
1
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 31, 23, 33, 25, 35, 27, 37, 29, 39, 30, 51, 32, 53, 34, 55, 36, 57, 38, 59, 41, 71, 43, 73, 45, 75, 47, 77, 49, 79, 50, 91, 52, 93, 54, 95, 56, 97, 58, 99, 61, 111, 63, 113, 65, 115, 67, 117, 69, 119, 70, 131, 72, 133, 74, 135, 76, 137, 78, 139, 81, 151, 83, 153, 85, 155, 87, 157, 89, 159
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
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
Sequence in context: A052425 A272074 A246097 * A022465 A296762 A247751
KEYWORD
nonn,base
AUTHOR
Eric Angelini, Aug 08 2016
STATUS
approved