OFFSET
1,2
COMMENTS
Terms computed by Claudio Meller.
It appears that this sequence contains all numbers except those in A115853.
LINKS
Michael De Vlieger, Log-log scatterplot of a(n) for n = 1..10000 labeling the first 40 terms.
EXAMPLE
a(2) = 10 because it is the smallest number that has exactly one digit in common with a(1) = 1; similarly, a(3) = 12 because it has one digit in common with a(2) = 10 and a(4) = 2 because it is the smallest number that is not already in the sequence that has exactly one digit in common with a(3) = 12.
MATHEMATICA
c[_] = False; j = c[1] = 1; {j}~Join~Reap[Do[d = Union@ IntegerDigits[j]; If[j == u, While[c[u] > 0, u++]]; k = u; While[Nand[c[k] == False, Count[IntegerDigits[k], _?(MemberQ[d, #] &)] == 1], k++]; Sow[k]; c[k] = True; j = k, 81]][[-1, -1]] (* Michael De Vlieger, Dec 31 2021 *)
PROG
(Python)
from itertools import islice
def c(s, t): return sum(t.count(si) for si in s)
def agen(): # generator of terms
an, target, seen, mink = 1, "1", {1}, 2
while True:
yield an
k = mink
while k in seen or c(str(k), target) != 1: k += 1
an, target = k, str(k)
seen.add(an)
while mink in seen: mink += 1
print(list(islice(agen(), 82))) # Michael S. Branicky, Dec 31 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rodolfo Kurchan, Dec 31 2021
STATUS
approved