title: Is there an efficient algorithm for integer partitioning with restricted number of parts?
body: <p>I have to create a method that takes two integers, let them be <code>n</code> and <code>m</code>, and returns how many ways there are to sum <code>m</code> positive numbers to get <code>n</code>. 
  For example, a method call like this <code>partition(6, 2)</code> should return 3 because there are 3 ways possible. They are <code>5 + 1</code>, <code>4 + 2</code>, and <code>3 + 3</code>. By the way, <code>4 + 2</code> is the same as <code>2 + 4</code>, so the method should not count them as two distinct variations. 
  Does anybody know a solution to the problem?</p>
  
  <p>Updated: <code>n</code> and <code>m</code> are not greater than 150.</p>