All possible sums

Nov 18, 2015 at 4:16pm
So my questions is, how many possible groups of 3 numbers, can have a sum equal to a number, lets say N.

Can you explain some sort of algorithm, I don't need code.


Thanks.
Last edited on Nov 18, 2015 at 4:18pm
Nov 18, 2015 at 4:32pm
How many possible groups of 3 numbers can have a sum equal to a number?


There are an infinite number of groups that would sum to a certain number if you do not provide any restrictions.
Nov 18, 2015 at 4:33pm
Oh wait, I forgot.

The numbers must be equal or more than 1, and not decimal.
Nov 18, 2015 at 4:38pm
Can there be repeated numbers? Eg. a=1, b=1, c=1?
Are these considers the same or different?
a=1, b=1, c=2
a=1, b=2, c=1
a=2, b=1, c=1
Nov 18, 2015 at 4:39pm
No, sequence doesn't matter. a=1, b=1, c=2 would be the same with a=2, b=1, c=1.
But, it is allowed that a=b or a=c or b=c or a=b=c.
Last edited on Nov 18, 2015 at 4:40pm
Topic archived. No new replies allowed.