An algorithm which for any input positive integer, gives all possible distinct arrays of positive non-zero integers that can sum to it.

e.g Inputting 4 returns (1,1,1,1), (1,1,2), (1,2,1), (2,1,1), (1,3), (3,1), (2,2), (4) 

Not homework, but "research". I just get lost trying.

Someone good at combinatorics would probably know this one.