Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A106432
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A106432 Levenshtein distance between successive powers of 2 in decimal representation. +0
1
1, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 6, 6, 5, 6, 6, 6, 6, 8, 8, 8, 9, 9, 8, 8, 8, 9, 8, 10, 10, 8, 10, 10, 11, 11, 11, 11, 10, 11, 13, 14, 13, 13, 14, 12, 11, 14, 10, 12, 14, 12, 16, 17, 16, 17, 17, 16, 15, 18, 17, 17, 18, 18, 17, 18, 20, 17, 16, 21, 19, 19, 20, 22, 20, 22, 21 (list; graph; listen)
OFFSET

0,4

COMMENT

a(n) = minimal number of editing steps (delete, insert or substitute) to transform 2^n into 2^(n+1) in decimal representation;

a(n) <= A034887(n).

LINKS

Michael Gilleland, Levenshtein Distance [It has been suggested that this algorithm gives incorrect results sometimes. - N. J. A. Sloane (njas(AT)research.att.com)]

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]] ]]; Table[ levenshtein[IntegerDigits[2^n], IntegerDigits[2^(n + 1)]], {n, 0, 80}] (* Robert G. Wilson v *)

CROSSREFS

Cf. A000079.

Sequence in context: A130255 A082527 A132944 this_sequence A029836 A004257 A156684

Adjacent sequences: A106429 A106430 A106431 this_sequence A106433 A106434 A106435

KEYWORD

nonn,base

AUTHOR

Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), Jan 22 2006

EXTENSIONS

More terms from Robert G. Wilson v (rgwv(at)rgwv.com), Jan 25 2006

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 25 20:09 EST 2009. Contains 167514 sequences.


AT&T Labs Research