login
Sequence S of positive integers such that the successive digits d of S are the successive Levenshtein distances between two adjacent terms of S. When possible, S is always extended with the smallest positive integer not yet present.
2

%I #9 Dec 01 2023 15:51:00

%S 1,2,10,11,11,12,13,3,4,5,14,15,200,6,1000,22111,2111,7,8,10000,100,

%T 100,100,222211,22211,22211,22211,22211,211,16,17,18,19,20,21,22,23,

%U 1000000,22111111,2111111,2111111,2111111,2111111,2111111,111111,111111,111111,11111,11111,11111,1111,1111,1111,101,30,9,24

%N Sequence S of positive integers such that the successive digits d of S are the successive Levenshtein distances between two adjacent terms of S. When possible, S is always extended with the smallest positive integer not yet present.

%H Éric Angelini, <a href="https://cinquantesignes.blogspot.com/2023/11/a-sequence-with-vladimir-iosifovich-and.html">A sequence with Vladimir Iosifovich (and his wife)</a>, Personal blog, Nov 2023.

%e The sequence starts with 1, 2, 10, 11, 11, 12, 13, 3.

%e a(1) = 1 is indeed the Ld (Levenshtein distance) between a(1) = 1 and a(2) = 2;

%e a(2) = 2 is the Ld between a(2) = 2 and a(3) = 10;

%e a(3) = 10 whose first digit 1 is the Ld between a(3) = 10 and a(4) = 11;

%e a(3) = 10 whose second digit 0 is the Ld between a(4) = 11 and a(5) = 11;

%e a(4) = 11 whose first digit 1 is the Ld between a(5) = 11 and a(6) = 12;

%e a(4) = 11 whose second digit 1 is the Ld between a(6) = 12 and a(7) = 13;

%e a(5) = 11 whose first digit 1 is the Ld between a(7) = 13 and a(8) = 3; etc.

%t 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]

%Y Cf. A118757, A151875.

%K base,nonn

%O 1,2

%A _Eric Angelini_ and _Giorgos Kalogeropoulos_, Nov 25 2023