The discussion of interesting tasks from the Czech national olympiad in informatics. Our task is to find all the different decompositions of a given natural number to the sum of positive integers and to determine the number of such decompositions.
While we use the recursion to list all the decompositions, we may determine their number using the method of dynamic programming.