A005836 by

def n(o, x):
    if x < 2:
        print o
        return
    if x % 3 - 2:
        n(o, x/3)

for x in range(0,1000):
    n(x,x)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top