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!)
A276690 Binary Barker codes written in base 10. 1

%I #27 Jan 14 2017 07:41:48

%S 2,3,6,13,14,29,114,1810,7989

%N Binary Barker codes written in base 10.

%C This is almost certainly the complete list of Barker codes.

%C Codes of the same length which also have similar autocorrelation function are considered as the same and only one code which has greatest value is stored. For example: for codes of length 5 in binary representation: 00010, 01000, 10111 and 11101 only one code 11101 (29 in decimal) should be stored. - _Sergiy Piyatakov_, Jan 13 2017

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/BarkerCode.html">Barker Code</a>

%e 29 (binary: 11101) is in the sequence because + + + - + is a Barker code.

%o (Python)

%o def ok(n):

%o t = [(-1)**int(x) for x in bin(n)[2:]]

%o return all(abs(sum(t[i]*t[i+k] for i in range(len(t)-k))) <= 1 for k in range(1, len(t)))

%o def not_dup(n):

%o b = bin(n)[2:]

%o i = ''.join('0' if c=='1' else '1' for c in b)

%o return b >= b[::-1] and b >= i[::-1]

%o a = [n for n in range(2, 2**13) if not_dup(n) and ok(n)]

%o print(a)

%o # _Andrey Zabolotskiy_, Jan 13 2017

%Y Cf. A091704.

%K nonn

%O 1,1

%A _Gordon Hamilton_, Sep 13 2016

%E Corrected by _Sergiy Piyatakov_, Jan 13 2017

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 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)