cp's OEIS Frontend

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.

A109382 Levenshtein distance between successive English names of nonnegative integers, excluding spaces and hyphens.

This page as a plain text file.
%I A109382 #30 Dec 01 2018 07:59:43
%S A109382 4,3,4,5,3,3,4,5,4,3,4,4,6,3,3,2,4,4,3,7,3,3,4,5,3,3,4,5,4,7,3,3,4,5,
%T A109382 3,3,4,5,4,7,3,3,4,5,3,3,4,5,4,6,3,3,4,5,3,3,4,5,4,6,3,3,4,5,3,3,4,5,
%U A109382 4,7,3,3,4,5,3,3,4,5,4,8,3,3,4,5,3,3,4,5,4,7,3,3,4,5,3,3,4,5,4,7,3,3,4,5,3,3
%N A109382 Levenshtein distance between successive English names of nonnegative integers, excluding spaces and hyphens.
%H A109382 Robert Israel, <a href="/A109382/b109382.txt">Table of n, a(n) for n = 0..10000</a>
%H A109382 Michael Gilleland, <a href="https://people.cs.pitt.edu/~kirk/cs1501/Pruhs/Spring2006/assignments/editdistance/Levenshtein%20Distance.htm">Levenshtein Distance, in Three Flavors</a>.
%H A109382 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.
%H A109382 Landon Curt Noll, <a href="http://www.isthe.com/chongo/tech/math/number/number.html">The English Name of a Number</a>.
%H A109382 Robert G. Wilson v, <a href="https://oeis.org/a001477/a001477.txt">American English names for the numbers from 0 to 100999 without spaces or hyphens</a>.
%F A109382 a(n) = LD(nameof(n), nameof(n+1)).
%e A109382 a(0) = 4 since LD(ZERO,ONE) requires 4 edits.
%e A109382 a(1) = 3 since LD(ONE,TWO) which requires 3 substitutions.
%e A109382 a(2) = 4 since LD(TWO,THREE) = requires 4 edits (leave the leftmost T unchanged), then 2 substitutions (W to H, O to R), then 2 insertions (E,E).
%e A109382 a(4) = 3 as LD(FOUR,FIVE) leaves the leftmost F unchanged, then requires 3 substitutions. From FIVE to SIX leaves the I unchanged. From SIX to SEVEN leaves the S unchanged. From TEN to ELEVEN leaves the EN unchanged. From ELEVEN to TWELVE leaves an E,L,V,E unchanged. From THIRTEEN to FOURTEEN leaves RTEEN unchanged. TWENTYNINE to THIRTY takes 7 edits. THIRTYNINE to FORTY takes 7 edits. SEVENTYNINE to EIGHTY takes 8 edits. EIGHTYNINE to NINETY takes 7 edits. NINETYNINE to ONEHUNDRED takes 7 edits.
%p A109382 with(StringTools):
%p A109382 seq(Levenshtein(Select(IsAlpha, convert(n,english)),Select(IsAlpha,convert(n+1,english))),n=0..200); # _Robert Israel_, Jan 23 2018
%t A109382 (* First copy b109382.txt out of A109382 then *) 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[x_] := Block[{str = ToString@ lst[[x]], len}, len = StringLength@ str; StringInsert[str, ",", Range[2, len]]]
%Y A109382 Cf. A001477, A005589, A081355, A081356, A081230, A109809, A109811.
%K A109382 easy,nonn,word
%O A109382 0,1
%A A109382 _Jonathan Vos Post_, Aug 25 2005
%E A109382 More terms from _Robert G. Wilson v_, Jan 31 2006
%E A109382 Corrected by _Robert Israel_, Jan 23 2018