def f(n): x=1, for i in range(n):x+=sum(x[-i//2:]), print(x[-1]) for n in (1,9,14,15,23): f(n)
Standard input is empty
1 42 1308 2605 664299
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!