login
Semiprimes at Levenshtein distance n from previous value when considered as a decimal string.
0

%I #13 Dec 01 2018 04:31:14

%S 4,6,10,221,1003,22226,100001,2222245,10000001,222222223,1000000006,

%T 2222222227,100000000013,2222222222249,10000000000015,222222222222223,

%U 10000000000000031,22222222222222229,100000000000000015

%N Semiprimes at Levenshtein distance n from previous value when considered as a decimal string.

%C For positive n, the string length of a(n+1) is always the 1 + the string length of a(n). This sequence is infinite.

%H Michael Gilleland, <a href="https://people.cs.pitt.edu/~kirk/cs1501/Pruhs/Spring2006/assignments/editdistance/Levenshtein%20Distance.htm">Levenshtein Distance, in Three Flavors</a>. [It has been suggested that this algorithm gives incorrect results sometimes. - _N. J. A. Sloane_]

%H V. I. Levenshtein, <a href="https://doi.org/10.1006/jcta.2000.3081">Efficient reconstruction of sequences from their subsequences or supersequences</a>, J. Combin. Theory Ser. A 93 (2001), no. 2, 310-332.

%e a(0) = 4 = 2^2.

%e a(1) = 6 because we transform a(0) = 4 to 6 = 2 * 3 (a semiprime) with one substitution.

%e a(2) = 10 because we transform a(1) = 6 to 10 = 2 * 5 with one substitution and one insertion.

%e a(3) = 221 because we transform a(2) = 10 to the least semiprime 221 = 13 * 17 with 1 substitution plus two insertion.

%e a(4) = 1003 because we transform a(3) = 221 to the least semiprime 1003 = 17 * 59 with 3 substitutions plus one insertion and any smaller semiprime can be transformed from 221 in fewer than 4 steps.

%e a(20) = 10000000000000000001 = 11 * 909090909090909091, which is the least semiprime of Levenshtein distance 20 from a(19) = 2222222222222222222 from which decimal string we transform to a(20) with 19 substitutions and one insertion.

%Y Cf. A001358, A081355, A081356, A081230, A109809, A109811.

%K easy,nonn,base

%O 0,1

%A _Jonathan Vos Post_, Aug 25 2005