Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Speedy category for Ulam–Warburton Automaton by Pactp
def automaton(step: int) -> int:
# The binary (Hamming) weight of n.
def bwt(n):
return bin(n).count('1')
return 1 + 4*sum( (3**(bwt(k)-1) for k in range(1,step)))
April 27, 2023