Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
60° wedge optimized solution in Speedy category for Ulam-Warburton Automaton Hex by juestr
from collections import Counter
def A169780(step):
offsets = (-1, 1, -1j, 1j, -1+1j, 1-1j)
fixed, active, n = {0}, [0], 1
for _ in range(step-1):
around = Counter(new for x in active for o in offsets
if (new := x + o).real >= 0 and new.imag >= 0 and new not in fixed)
fixed.update(around.keys())
active = [x for x, n in around.items() if n == 1]
n += len(active)
return n
def automaton(step: int) -> int:
return 6 * (A169780(step) - step) + 1
April 9, 2023
Comments: