OFFSET
1,2
COMMENTS
The conjugate of a binary sequence is a cyclic shift. For example, 001011 and 110010 are conjugates because if you rotate the first 4 places to the left, you get the second.
The Hamming distance is the number of bits that are different.
It appears that a(2*p) = 4*p*(2^(p-2)-1), for p prime. - Giovanni Resta, Jul 09 2018
LINKS
Jeffrey Shallit, Hamming distance for conjugates, Discrete Mathematics 309(12): 4197-4199 (2009).
EXAMPLE
a(6) = 12, with examples being 001011, 001101, 010011, 010110, 011001, 011010, and their complements (0's and 1's interchanged). The conjugates of 001011 are: 010110, 101100, 011001, 110010, and 100101, which have Hamming distances 4, 4, 2, 4, and 4, respectively, so exactly one has distance 2.
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):
c = 0
for s in range(1, len(w)):
if h(w, w[s:]+w[:s]) == 2:
c += 1
if c == 2:
return False
return c == 1
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
KEYWORD
nonn,more
AUTHOR
Jeffrey Shallit, Jan 09 2011
EXTENSIONS
a(17)-a(40) from Falk Hüffner, Jul 08 2018
a(41)-a(42) from Giovanni Resta, Jul 09 2018
STATUS
approved