A118767 Fixed points of permutations A118763, A118764, A118765 and A118766.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 29, 49, 69, 89
Offset: 1
Crossrefs
Cf. A118761.
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
levenshtein[s_List, t_List] := Module[{d, n = Length@ s, m = Length@ t}, Which[s === t, 0, n == 0, m, m == 0, n, s != t, d = Table[0, {m + 1}, {n + 1}]; d[[1, Range[n + 1]]] = Range[0, n]; d[[Range[m + 1], 1]] = Range[0, m]; Do[ d[[j + 1, i + 1]] = Min[d[[j, i + 1]] + 1, d[[j + 1, i]] + 1, d[[j, i]] + If[ s[[i]] === t[[j]], 0, 1]], {j, m}, {i, n}]; d[[ -1, -1]] ]]; f[lst_] := Block[{k = 1, l = IntegerDigits[ lst[[-1]]]}, While[ MemberQ[lst, k] || levenshtein[l, IntegerDigits[k]] > 1, k++]; Append[lst, k]]; Nest[f, {0}, 100] (* Robert G. Wilson v, Sep 22 2016 *)
from itertools import islice from Levenshtein import distance as Ld def agen(): # generator of terms an, aset, mink = 0, {0}, 1 while True: yield an s, k = str(an), mink while k in aset or Ld(s, str(k)) != 1: k += 1 an = k aset.add(k) while mink in aset: mink += 1 print(list(islice(agen(), 73))) # Michael S. Branicky, Dec 01 2023
Comments