A number as it's prime number parts
I have to print the number of ways you can represent a given number as it's prime number parts. Let me clarify: Let's say I have been given this number 7. Now, first of all, I have to find all the prime numbers that are less than 7, which are 2, 3 and 5. Now, in how many ways can I summarize those numbers (I can use one number as many times I want) so that the result equals 7? For example, number 7 has five ways: 2 + 2 + 3 2 + 3 + 2 2 + 5 3 + 2 + 2 5 + 2 I'm totally lost with this task. First I figured I'd make an array of usable elements like so: { 2, 2, 2, 3, 3, 5 } (7/2 = 3, so 2 must