%I #11 Mar 14 2020 06:55:30
%S 23,29,46,58,71,92,113,116,139,142,163,184,197,209,226,232
%N Numbers whose 8-bit binary representation, when rotated by up to one bit, contains every 3-bit binary representation for the numbers 0 through 7.
%C The binary representations of these numbers are equivalent under rotation / complement.
%C When this binary representation, with two bits from one end concatenated to the other, is given as input to an elementary cellular automaton, the first line of output will uniquely identify the rule of the automaton.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/ElementaryCellularAutomaton.html">Elementary Cellular Automaton</a>
%e 23 has the 8-bit representation 00010111.
%e Concatenate the last two digits onto the beginning to get 1100010111.
%e We read off the 3-bit substrings:
%e 110
%e 100
%e 000
%e 001
%e 010
%e 101
%e 011
%e 111
%o (Sage)
%o i = 0
%o while i < 256:
%o bin = i.binary()
%o bin = bin[ -2:] + "0"*(8-len(bin)) + bin
%o subs = []
%o for j in range(8):
%o k = bin[j:j+3]
%o if k not in subs:
%o subs.append(k)
%o else: break
%o if len(subs) == 8: print(i)
%o i += 1
%K fini,full,nonn
%O 1,1
%A _Tomas Boothby_, Feb 01 2007
|