|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
FORMULA
|
|
|
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)))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|