|
|
A350445
|
|
a(n) is the smallest number larger than a(n-1) that has only one digit in common with a(n-1).
|
|
5
|
|
|
1, 10, 12, 13, 14, 15, 16, 17, 18, 19, 21, 23, 24, 25, 26, 27, 28, 29, 32, 34, 35, 36, 37, 38, 39, 43, 45, 46, 47, 48, 49, 54, 56, 57, 58, 59, 65, 67, 68, 69, 76, 78, 79, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 108, 122, 130, 142, 150, 162, 170, 182, 190, 202, 301, 322, 340, 351, 360, 371, 380, 391, 401, 422, 430
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
a(11) = 21 because it is the smallest number larger than a(10) = 19 that has exactly one digit in common.
Similarly, a(55) = 108 because it is the smallest number larger than a(54) = 98 that has exactly one digit in common.
|
|
MATHEMATICA
|
j = 1; {j}~Join~Reap[Do[d = Union@ IntegerDigits[j]; k = j + 1; While[Count[IntegerDigits[k], _?(MemberQ[d, #] &)] != 1, k++]; Sow[k]; j = k, 82]][[-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 = 1, "1"
while True:
yield an
k = an + 1
while c(str(k), target) != 1: k += 1
an, target = k, str(k)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|