Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

$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|cite|improve this question

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|cite|improve this answer

Your Answer


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.