Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A115778
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A115778 Consider the Levenshtein distance between k considered as a decimal string and k considered as a binary string. Then a(n) is the least number m such that the Levenshtein distance is n or 0 if no such number exists. +0
3
1, 0, 2, 4, 8, 22, 32, 64, 222, 256, 512, 2044, 2222, 4222, 8192, 22222, 32768, 65536, 222222, 262144, 524288, 2097152, 2222222, 4194322, 8388622, 22222222 (list; graph; listen)
OFFSET

0,3

COMMENT

Difference between A115779&A115778: 1, 0, 9, 11, 103, 99, 979, 1047, 1789, 10855, 15599, 109067, 128789, 1006889, 1102919, 1988889, 11078343, ...,.

FORMULA

a(1)=0 since no number satisfies the definition and generally a(n)>= 2^(n+1).

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]]]];

t = Table[0, {25}]; f[n_] := levenshtein[ IntegerDigits[n], IntegerDigits[n, 2]]; Do[a = f[n]; If[ t[[a+1]] == 0, t[[a+1]] = n; Print[{a, n}]], {n, 10^6}]; t

CROSSREFS

Cf. A000027, A007088, A115777.

Sequence in context: A055876 A065847 A133604 this_sequence A027713 A027385 A002075

Adjacent sequences: A115775 A115776 A115777 this_sequence A115779 A115780 A115781

KEYWORD

more,nonn

AUTHOR

Robert G. Wilson v (rgwv(AT)rgwv.com), Jan 26 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 18 20:14 EST 2008. Contains 147244 sequences.


AT&T Labs Research