Find possible sums that create N

20 Views Asked by At

I want to create a function that creates an array with every permutation of the sum of positive integers that create a given integer (N).

The example N = 3 would create an array of:

1 + 1 + 1 2 + 1

As I am not a mathematician I do not know the correct terminology so even answers about that would be helpful.