login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A179674 Number of binary sequences of length n having a conjugate at Hamming distance 2. 2

%I #44 Mar 15 2022 02:59:42

%S 0,2,6,12,30,54,98,160,234,400,462,864,806,1722,1530,3328,1938,7290,

%T 2774,13360,6090,26422,5106,60096,7900,113256,21600,240240,10614,

%U 535980,13082,1065984,82962,2244340,34650,4894560,22718,9984462,345930,21050240,31242,44773848,36206

%N Number of binary sequences of length n having a conjugate at Hamming distance 2.

%H Jon Maiga, <a href="http://sequencedb.net/s/A179674">Computer-generated formulas for A179674</a>, Sequence Machine.

%H Jeffrey Shallit, <a href="https://doi.org/10.1016/j.disc.2008.11.001">Hamming distance for conjugates</a>, Discrete Mathematics 309(12): 4197-4199 (2009).

%F a(n) = n * A226893(n) [uncovered by sequencedb.net]. - _Falk Hüffner_, Aug 15 2021

%e For n = 3 the a(3) = 6 solutions are all 8 strings except 000, 111.

%o (Python)

%o from itertools import product

%o def h(w, x): return sum(1 for wi, xi in zip(w, x) if wi != xi)

%o def ok(w):

%o return any(h(w, w[s:]+w[:s]) == 2 for s in range(1, len(w)))

%o def a(n):

%o return 2*sum(1 for p in product("01", repeat=n-1) if ok("0"+"".join(p)))

%o print([a(n) for n in range(1, 19)]) # _Michael S. Branicky_, Mar 14 2022

%Y Cf. A179677, A226893.

%K nonn

%O 1,2

%A _Jeffrey Shallit_, Jan 09 2011

%E a(18)-a(40) from _Falk Hüffner_, Jul 08 2018

%E a(41)-a(43) from _Falk Hüffner_, Aug 15 2021

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:08 EDT 2024. Contains 371964 sequences. (Running on oeis4.)