OFFSET
1,4
COMMENTS
The first 21 terms match the most frequent possible outcome (see comment in A332717) with the exception of a(14) which is the second-most frequent. - Hans Havermann, Jun 11 2020
LINKS
Pontus von Brömssen, Table of n, a(n) for n = 1..1000
Eric Weisstein's World of Mathematics, Rule 110
EXAMPLE
For n=4, the evolution of a single cell is:
0001
0011
0111 <--= period starts
1101
0111 <--= again start of period
etc, so a(4)=2.
MATHEMATICA
a[n_] := -Subtract @@
Flatten[Map[Position[#, #[[-1]]] &,
NestWhileList[CellularAutomaton[110],
Prepend[Table[0, {n - 1}], 1], Unequal, All], {0}]]
PROG
(Sage)
def A180001(n):
def bit(x, i): return (x >> i) & 1
rulemap = dict((tuple(bit(i, k) for k in reversed(range(3))), bit(110, i)) for i in range(8))
def neighbours(d, i): return tuple(d[k % n] for k in [i-1..i+1])
v = [0]*n; v[-1] = 1;
history = [v]
while True:
v2 = [rulemap[neighbours(history[-1], i)] for i in range(n)]
if v2 in history: return len(history)-history.index(v2)
history.append(v2) # D. S. McNeil, Jan 15 2011
CROSSREFS
KEYWORD
nonn
AUTHOR
Ben Branman, Jan 13 2011
EXTENSIONS
More terms from Alois P. Heinz, Jan 14 2011
STATUS
approved