|
|
A332917
|
|
A332916(n)/2^a(n) is the average number of binary strings of length n with Levenshtein distance <= 3 from a uniform randomly sampled binary string of this length.
|
|
2
|
|
|
0, 1, 4, 4, 6, 5, 8, 8, 10, 8, 12, 12, 14, 13, 16, 16, 18, 15, 20, 20, 22, 21, 24, 24, 26, 24, 28, 28, 30, 29, 32, 32, 34, 30, 36, 36, 38, 37, 40, 40, 42, 40, 44, 44, 46, 45, 48, 48, 50, 47, 52, 52, 54, 53, 56, 56, 58, 56, 60, 60, 62, 61, 64, 64, 66, 61, 68, 68
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
3,3
|
|
COMMENTS
|
|
|
LINKS
|
|
|
PROG
|
(PARI) f(n)=(40+6*n-4*n^2)/2^n-83/2+331/12*n-6*n^2+2/3*n^3;
for(k=3, 70, print1(round(log(denominator(f(k)))/log(2)), ", "))
(Python)
from fractions import Fraction
def f(n): return Fraction(40+6*n-4*n**2, 2**n) - Fraction(83, 2) + Fraction(331*n, 12) - 6*n**2 + Fraction(2*n**3, 3)
def a(n): return (f(n).denominator).bit_length() - 1
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,frac
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|