(Translated by https://www.hiragana.jp/)
The On-Line Encyclopedia of Integer Sequences® (OEIS®)
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)

Revision History for A115777

(Underlined text is an addition; strikethrough text is a deletion.)

Showing all changes.
A115777 Levenshtein distance between n considered as a decimal string and n considered as a binary string.
(history; published version)
#6 by Joerg Arndt at Sat Dec 01 04:37:24 EST 2018
STATUS

editing

approved

#5 by Joerg Arndt at Sat Dec 01 04:37:09 EST 2018
COMMENTS

The Levenshtein distance (also called edit distance) between two strings is equal to the minimum number of insertion, deletion, or substitution operations needed to transform one string into the other. It is named after the Russian scientist Vladimir Levenshtein, who developed this metric in 1965. Levenshtein distance is a generalization of Hamming distance.

STATUS

approved

editing

Discussion
Sat Dec 01 04:37
Joerg Arndt: Plagiarism.
#4 by Russ Cox at Fri Mar 30 17:31:17 EDT 2012
AUTHOR

_Robert G. Wilson v (rgwv(AT)rgwv.com), _, Jan 26 2006

Discussion
Fri Mar 30 17:31
OEIS Server: https://oeis.org/edit/global/156
#3 by Russ Cox at Fri Mar 30 16:50:23 EDT 2012
LINKS

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 (njas(AT)research.att.com)]_]

Discussion
Fri Mar 30 16:50
OEIS Server: https://oeis.org/edit/global/110
#2 by N. J. A. Sloane at Fri Feb 27 03:00:00 EST 2009
LINKS

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 (njas](AT)research.att.com)]

KEYWORD

base,nonn,new

#1 by N. J. A. Sloane at Fri Feb 24 03:00:00 EST 2006
NAME

Levenshtein distance between n considered as a decimal string and n considered as a binary string.

DATA

0, 2, 2, 3, 3, 3, 3, 4, 4, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 4, 4, 5, 5, 5, 5

OFFSET

1,2

COMMENTS

a(n) = minimal number of editing steps (delete, insert or substitute) to transform n_10 into n_2.

The Levenshtein distance (also called edit distance) between two strings is equal to the minimum number of insertion, deletion, or substitution operations needed to transform one string into the other. It is named after the Russian scientist Vladimir Levenshtein, who developed this metric in 1965. Levenshtein distance is a generalization of Hamming distance.

LINKS

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

MATHEMATICA

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[n_] := levenshtein[ IntegerDigits[n], IntegerDigits[n, 2]]; Array[f, 105]

CROSSREFS

Cf. A000027, A007088, first occurrence: A115778.

KEYWORD

base,nonn

AUTHOR

Robert G. Wilson v (rgwv(AT)rgwv.com), Jan 26 2006

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 26 17:36 EDT 2024. Contains 375462 sequences. (Running on oeis4.)