Given an integer, compute its Levenshtein code
Haskell, 70 bytes

b 0=[]
b n=b(div n 2)++[mod n 2]
f 0=[0]
f n|1:t&lt;-b n=1:f(length t)++t


Defines a function f : Int -&gt; [Int]. For example, f 5 == [1,1,1,0,0,0,1].