Originally Posted by

**lali** Given a positive number x, find the number of ways in which n positive numbers can be added to get a sum x.

n<=x

example x=8,n=2

answer = 4

The combinations are:

(1,7)

(2,6)

(3,5)

(4,4)

example 2: x=8,n=3

answer = 5

The combinations are:

(1,1,6)

(1,2,5)

(1,3,4)

(2,3,3)

(2,2,4)

example 3: x=8,n=4

answer=4

(1,1,1,5)

(1,1,2,4)

(1,1,3,3)

(1,2,2,3)

I was just wondering if i can obtain a formula from above.

**Sorry if i posted in the wrong forum. I could not find a forum for combinatorics.**

Regards

lali