login
A179674
Number of binary sequences of length n having a conjugate at Hamming distance 2.
2
0, 2, 6, 12, 30, 54, 98, 160, 234, 400, 462, 864, 806, 1722, 1530, 3328, 1938, 7290, 2774, 13360, 6090, 26422, 5106, 60096, 7900, 113256, 21600, 240240, 10614, 535980, 13082, 1065984, 82962, 2244340, 34650, 4894560, 22718, 9984462, 345930, 21050240, 31242, 44773848, 36206
OFFSET
1,2
LINKS
Jon Maiga, Computer-generated formulas for A179674, Sequence Machine.
Jeffrey Shallit, Hamming distance for conjugates, Discrete Mathematics 309(12): 4197-4199 (2009).
FORMULA
a(n) = n * A226893(n) [uncovered by sequencedb.net]. - Falk Hüffner, Aug 15 2021
EXAMPLE
For n = 3 the a(3) = 6 solutions are all 8 strings except 000, 111.
PROG
(Python)
from itertools import product
def h(w, x): return sum(1 for wi, xi in zip(w, x) if wi != xi)
def ok(w):
return any(h(w, w[s:]+w[:s]) == 2 for s in range(1, len(w)))
def a(n):
return 2*sum(1 for p in product("01", repeat=n-1) if ok("0"+"".join(p)))
print([a(n) for n in range(1, 19)]) # Michael S. Branicky, Mar 14 2022
CROSSREFS
Sequence in context: A081375 A024701 A224532 * A038199 A056267 A348412
KEYWORD
nonn
AUTHOR
Jeffrey Shallit, Jan 09 2011
EXTENSIONS
a(18)-a(40) from Falk Hüffner, Jul 08 2018
a(41)-a(43) from Falk Hüffner, Aug 15 2021
STATUS
approved