I'm trying to write a computer program that takes in any integer and tells me how many different ways I can add numbers up to get that number. For example, the number 3 would have 3 different ways(excluding 0): 1+2,2+1, and 1+1+1. The programming part isn't really what I'm struggling with, it's the mathematics behind it that I'm not understanding. How could I create a general (maybe recursive) function to this problem?
Wikipedia has an article on it but it didn't help me so much: http://en.wikipedia.org/wiki/Partition_function_(number_theory)#Asymptotic_behaviour
Can anyone provide some insight as to how I would go about doing something like this?
Thanks
Wikipedia has an article on it but it didn't help me so much: http://en.wikipedia.org/wiki/Partition_function_(number_theory)#Asymptotic_behaviour
Can anyone provide some insight as to how I would go about doing something like this?
Thanks