login
Number of numbers that differ from n in decimal representation by exactly one edit-operation: deletion, insertion, or substitution.
3

%I #6 Mar 30 2012 18:50:31

%S 18,27,27,27,27,27,27,27,27,27,46,45,46,46,46,46,46,46,46,46,46,46,45,

%T 46,46,46,46,46,46,46,46,46,46,45,46,46,46,46,46,46,46,46,46,46,45,46,

%U 46,46,46,46,46,46,46,46,46,45,46,46,46,46,46,46,46,46,46,46,45,46,46

%N Number of numbers that differ from n in decimal representation by exactly one edit-operation: deletion, insertion, or substitution.

%C a(n) = #{i: LevenshteinDistance(n,i)=1}.

%H Michael Gilleland, <a href="http://www.merriampark.com/ld.htm">Levenshtein Distance</a>. [It has been suggested that this algorithm gives incorrect results sometimes. - _N. J. A. Sloane_]

%e n=42: numbers at Levenshtein distance 1 from 42: {2, 4, 12, 22, 32, 40, 41, 43, 44, 45, 46, 47, 48, 49, 52, 62, 72, 82, 92, 142, 242, 342, 402, 412, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 432, 442, 452, 462, 472, 482, 492, 542, 642, 742, 842, 942}, therefore a(42)=46.

%K nonn,base

%O 0,1

%A _Reinhard Zumkeller_, Apr 01 2003