Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
One line proc (60 symbols) solution in Clear category for Ulam–Warburton Automaton by CDG.Axel
def automaton(step: int) -> int:
return sum(3 ** i.bit_count() for i in range(2 * step)) // 3
# optimization for my previous solution
# return max(0, (4 * sum(3 ** i.bit_count() for i in range(step)) - 1) // 3)
March 15, 2023