OFFSET
1,2
LINKS
Éric Angelini, A sequence with Vladimir Iosifovich (and his wife), Personal blog, Nov 2023.
EXAMPLE
The sequence starts with 1, 2, 10, 11, 11, 12, 13, 3.
a(1) = 1 is indeed the Ld (Levenshtein distance) between a(1) = 1 and a(2) = 2;
a(2) = 2 is the Ld between a(2) = 2 and a(3) = 10;
a(3) = 10 whose first digit 1 is the Ld between a(3) = 10 and a(4) = 11;
a(3) = 10 whose second digit 0 is the Ld between a(4) = 11 and a(5) = 11;
a(4) = 11 whose first digit 1 is the Ld between a(5) = 11 and a(6) = 12;
a(4) = 11 whose second digit 1 is the Ld between a(6) = 12 and a(7) = 13;
a(5) = 11 whose first digit 1 is the Ld between a(7) = 13 and a(8) = 3; etc.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=If[Flatten[IntegerDigits/@(ar=Array[a, n-1])][[n-1]]==0, a[n-1], (k=1; While[MemberQ[ar, k]||EditDistance[ToString@a[n-1], ToString@k]!=Flatten[IntegerDigits/@Join[ar, {k}]][[n-1]], k++]; k)]; Array[a, 23]
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Eric Angelini and Giorgos Kalogeropoulos, Nov 25 2023
STATUS
approved