Let us suppose we are having a number "n" and we want to generate sequence of numbers where each sequence gives the sum is equal to "n". Let n = 5 and intially we can write as 1 + 1 + 1 + 1 + 1 = 5. Now there are 4 barrier (X) as shown in Figure-1 in between these "ones"where we can place our barrier. Figure-1 What I mean by barrier is like this (11|11|1) where | represents a barrier, hence our paritition will be (2, 2, 1) for 5 or we can place our barriers like this (1|111|1) where our partition will be (1, 3, 1)...