Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

$a + b + c + d = 22$

where $\{a,b,c,d\}$ are distinct integers,

and for each $x \in \{a,b,c,d\}, 1 \le x \le 9$.

Is there an elegant solution?

share|improve this question
add comment

1 Answer 1

Count only the cases with $a<b<c<d$ and multiply with $4!=24$ afterwards. Necessarily, $d\ge 7$, as otherwise $a+b+c+d\le 3+4+5+6=18<22$. If $d=7$, then necessarily $a=4, b=5, c=6$, which gives us one solution $(4,5,6,7)$. If $d=8$, we have the solution $(3,5,6,8)$, by increasing $c$ $(2,5,7,8)$ and $(3,4,7,8)$. If $d=9$, there are again few enough solutions to count "by hand": $(1,4,8,9)$, $(2,3,8,9)$, $(1,5,7,9)$, $(2,4,7,9)$, $(2,5,6,9)$, $(3,4,6,9)$. So the grand total is $240$.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.