Tom from Bristol Grammar School sent us
his work on this problem.
We have an equation of the form
where all of the unknowns are
integers, and we know
and
(the lengths of our coloured rods) and
(the length of our white rod) and want to find
and
. In this
problem we are interested in the existence of
and
(do there exist
integers that solve the problem?).
In our initial case we have
(or
, we can reverse the signs
of
and
to negate the equation, so this does not matter). Clearly
this equation has solutions, one of which is
.
Now, in our equation
let the highest common factor of
and
be
with
and
(
and
both integers also). Our equation becomes
.
However, the only factors of 1 are
, so
. Therefore, for our
equation to have any solutions,
and
cannot have any common
factors (are coprime), so, for example,
,
will not work because
they both share factor 3. Interestingly, this means we can make
whatever value we choose, because
and
must be coprime (with their common factors extracted out as
), and we can choose
and
to make
and
then multiply them by anything to get any other integer.
We can extend this logic to the general form
, so
. Therefore, we will have solutions if and
only if
is a factor of
(since
can be
anything).
I'll complete my solution with a few examples.
has no
solutions, because 18 (the highest common factor of 36 and 54) does not
divide 47.
has solutions because 5 does divide 10 (for
example,
,
). With actual numbers in
,
,
, the
fact we established above becomes fairly obvious, because we can divide
through by the highest common factor to get
and
(here 6 and 5), and because they are coprime, we can find
,
with
so multiplying
and
by
gives our solution.
This is an example of a "linear Diophantine equation", a concept in
number theory.
Tom noticed that if a' and b' are coprime
then we can find integers x and y such that a'x+b'y=1. This
result is sometimes known as Bezout's Theorem; can you find a
proof?