login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

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
OFFSET
3,3
COMMENTS
See A332916 for more information.
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
print([a(n) for n in range(3, 71)]) # Michael S. Branicky, Aug 31 2021
CROSSREFS
Sequence in context: A071256 A078240 A296844 * A016710 A225134 A121064
KEYWORD
nonn,frac
AUTHOR
Hugo Pfoertner, Mar 05 2020
STATUS
approved