OFFSET
1,3
COMMENTS
A word x has a border with two mismatches if there are an equal-length prefix p and suffix s (nonempty, not equal to x, but allowed to overlap) such that the Hamming distance of p and s is exactly two. For example, the English word 'added' has a prefix 'add' and a suffix 'ded' at Hamming distance two.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..40
Michael S. Branicky, Python program
S. Klavžar and S. Shpectorov, Asymptotic number of isometric generalized Fibonacci cubes, European J. Combin. 33 (2012) 220-226.
EXAMPLE
For n = 3 the only examples are 010 and 101.
PROG
(Python) # see link for faster, bit-based version
from itertools import product
def ham(w, v): return sum(w[i] != v[i] for i in range(len(w)))
def m(b):
for i in range(2, len(b)):
p, s = b[:i], b[-i:]
if ham(p, s) == 2: return True
return False
def a(n): return 2*sum(m("0"+"".join(b)) for b in product("01", repeat=n-1))
print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Jul 24 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, Jul 24 2021
EXTENSIONS
a(31)-a(36) from Michael S. Branicky, Jul 24 2021
STATUS
approved