Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
simulate 60° wedge solution in Clear category for Ulam-Warburton Automaton Hex by juestr
def hex_neighbors(x, y):
return {(x-1, y), (x+1, y), (x, y-1), (x, y+1), (x-1, y+1), (x+1, y-1)}
def A169780(step):
on = active = {(0, 0)}
for _ in range(step-1):
active = {(nx, ny)
for ax, ay in active
for nx, ny in hex_neighbors(ax, ay)
if nx >= 0 and ny >= 0 and (nx, ny) not in on
if len(hex_neighbors(nx, ny) & on) == 1}
on |= active
return len(on)
def automaton(step: int) -> int:
return 6 * (A169780(step) - step) + 1
March 10, 2023
Comments: