<s>[INST] Confusion with solution to UKMT question There was a question I was trying to solve from the UKMT Senior Maths Challenge. It goes like this:
Four positive integers a, b, c, and d are such that

abcd + abc + bcd + cda + dab + ab + bc + cd + da + ac + bd + a + b + c + d = 2009

What is the value of a + b + c + d?

I have both seen and understood most of the solution. It looks something like:


Recognise that the LHS can be written as (a + 1)(b + 1)(c + 1)(d + 1) - $1$

Add 1 to both sides. Now it becomes (a + 1)(b + 1)(c + 1)(d + 1) = $2010$

Express $2010$ as a product of its primes. $2010$ = $2\times 3 \times 5 \times 67$.

It follows from there that a + b + c + d = $1 + 2 + 4 + 66 = 73$
I have a problem with the first step. I would just like to know if I'm expected to know right off the bat that the LHS can be simplified in that way, or is there a way to work it out and if there is, please can you give me hints on how to do so.
 [/INST] $$abcd + abc + bcd + cda + dab + ab + bc + cd + da + ac + bd + a + b + c + d$$
You can gather together all the terms containing for example $a$, and take it out to get this:
$$a(bcd + bc + cd + bd + b + c + d + 1) + bcd + bc + cd + bd + b + c + d$$
Clearly all the later terms are almost the same as the terms inside the brackets, except for the $1$. This suggests it can be simplified further:
$$a(bcd + bc + cd + bd + b + c + d + 1) + bcd + bc + cd + bd + b + c + d + 1 - 1$$
$$a(bcd + bc + cd + bd + b + c + d + 1) + 1(bcd + bc + cd + bd + b + c + d + 1) - 1$$
$$(a+1)(bcd + bc + cd + bd + b + c + d + 1) - 1$$
You can then repeat this factoring using variable $b$ and then $c$:
$$(a+1)(bcd + bc + bd + b + cd + c + d + 1) - 1$$
$$(a+1)(b(cd + c + d + 1) + cd + c + d + 1) - 1$$
$$(a+1)(b(cd + c + d + 1) + 1(cd + c + d + 1)) - 1$$
$$(a+1)(b+1)(cd + c + d + 1) - 1$$
$$(a+1)(b+1)(c(d + 1) + d + 1) - 1$$
$$(a+1)(b+1)(c(d + 1) + 1(d + 1)) - 1$$
$$(a+1)(b+1)(c+1)(d + 1) - 1$$
</s>