Quote:
I spend some time on the above problem, but don't know how to proceed ?
The first step is to figure out the maths.
For 1 step, answer is 1 because {1}
For 2 step, answer is 2 because {1,1}, {2}
For 3 step, answer is 4 because {1,1,1}, {1,2}, {2,1}, {3}
...
There you find a formula or you find a way to enumerate all possibilities and count them.
At this point, you should have a pretty good idea of how to program it.