OFFSET
0,3
COMMENTS
FORMULA
a(1)=0 since no number satisfies the definition and generally a(n)>= 2^(n+1).
MAPLE
f:= n -> StringTools:-Levenshtein(convert(n, string), convert(convert(n, binary), string)):
A:= Vector(20):
for n from 3 to 10^6 do
v:= f(n);
if A[v] = 0 then A[v]:= n fi
od:
1, 0, seq(A[n], n=2..20); # Robert Israel, Jul 16 2015
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
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Jan 26 2006
EXTENSIONS
a(26)-a(35) from Lars Blomberg, Jul 16 2015
STATUS
approved