Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A115780
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A115780 Consider the Levenshtein distance between k considered as a decimal string and k considered as a binary string. Then a(n) is the number of nonnegative integers having a Levenshtein distance of n. +0
1
2, 0, 4, 8, 14, 32, 60, 140, 212, 750, 1322, 2540, 6862, 13040, 27174, 57052, 117164, 248360, 555254 (list; graph; listen)
OFFSET

0,1

COMMENT

a(n)~2^n. a(n)-2^n: -1,2,0,0,2,0,4,12,44,238,298,492,2766,4848,10790,24284,51628,117288,293110, ...,.

EXAMPLE

a(0)=2 since only 0&1 have a Levenshtein distance of zero when considering them as decimal and binary strings,

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[ t[[f@n+1]]++, {n, 10^6}]; t

CROSSREFS

Cf. A000027, A007088, A115777.

Sequence in context: A120558 A120554 A120710 this_sequence A101189 A001443 A070015

Adjacent sequences: A115777 A115778 A115779 this_sequence A115781 A115782 A115783

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 27 22:38 EST 2009. Contains 167602 sequences.


AT&T Labs Research