You do realize that the partition function P(n), the number of ways a natural number n can be partitioned as the sum of smaller numbers, is given by Hardy and Ramanujan's complicated formula:

where

Are you attempting to place an upper limit on the highest addend in effort to simplify this formula? Or do you seek an algorithmic solution?