For example, 5 can be written in 2 ways:
- 4 + 1
- 3 + 2
8 can be written in 5 ways:
- 7+1
- 6+2
- 5+3
- 5+2+1
- 4+3+1
How could this be determined for any positive integer N?
Computer Science Stack Exchange is a question and answer site for students, researchers and practitioners of computer science. It only takes a minute to sign up.
Sign up to join this communityThis is known as the number of strict partitions. Wikipedia contains a number of results on this. You can compute the number using dynamic programming.