How could I create a function that takes in an int and counts how many ways that number can be added up? For example, the number 3 would have the following as possible ways to be added up: 1+2,2+1,1+1+1, so 3 different ways. The function would return 3.
Thanks
edit: the syntax of it all isn't really what I'm looking for, I just need help trying to think of how this could be accomplished mathematically.