def do(x, level=6): return x == 20 if level == 0 else do(x+1, level-1) + do(x+2, level-1) + do(x*2, level-1) print(do(1))
Standard input is empty
36
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!