0
$\begingroup$

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?

$\endgroup$
0

1 Answer 1

0
$\begingroup$

This is known as the number of strict partitions. Wikipedia contains a number of results on this. You can compute the number using dynamic programming.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.