Math Kangaroo USA
International Competition in Mathematics
for K-12 students

Login  |    Registration  |    Donate

Broken Calculator

Broken Calculator

Hints:

  1. One straightforward (but uninteresting) way to build all numbers is by using the identity:

    1=4+4−7

    Then, multiply it as needed.
    For example:

    3=(4+4−7)+(4+4−7)+(4+4−7)

    Or more compactly:

    3=4+4+4+4+4+4−7−7−7

  2. The key insight:
    Once you know the smallest positive number you can make, you can build all multiples of it.

  3. That smallest positive number will always be the greatest common factor (GCF) of the numbers you’re using (in this case, 4 and 7).
    So ask: What is the GCF of 4 and 7?

Solution:

The students are exploring which numbers can be made by adding or subtracting any multiples of 4 and 7. What they are unknowingly discovering is a fundamental concept from number theory called Bézout’s Theorem.


Bézout’s Theorem (Informal Statement):

For any two integers, the set of all numbers that can be written as:

a×4+b×7

(where a and b are integers, possibly negative) is exactly the set of multiples of the greatest common divisor (GCD) of 4 and 7.

  • Since GCD(4, 7) = 1, we can create every integer, both positive and negative.

  • There are also infinitely many ways to write each number using different combinations of 4s and 7s.


Examples (Numbers from 1 to 12):

Here are some sample combinations showing how each number can be expressed as a linear combination of 4 and 7:

Number Expression
1 4 + 4 – 7 = 9 x 4 – 5 x 7 = 16 x 4 – 9 x 7
2 7 + 7 – 4 – 4 – 4 = 6 x 7 – 10 x 4 = 10 x 7 – 17 x 4
3 7 – 4 = 5 x 7 – 8 x 4 = 9 x 7 – 15 x 4
4 4 x 7 – 6 x 4 = 8 x 7 – 13 x 4
5 3 x 4 – 7
6 2 x 7 – 2 x 4
7 7
8 2 x 4
9 3 x 7 – 3 x 4
10 2 x 7 – 4
11 4 + 7
12
3 x 4

General Strategy:

Once you know any expression for 1 (the GCD), you can generate all other numbers by scaling.
For example:

1=2×4−7

Multiply both sides by 23:

23 = 23 (2 x 4 – 7) = 46 x 4 – 23 x 7.


Generating More Solutions:

If you have one solution, you can create infinitely many others by adding or subtracting any multiple of the identity:

7×4−4×7=0

This means:

1 = 2 x 4 – 7 = (2 x 4 – 7) + (7 x 4 – 4 x 7) = 9 x 4 – 5 x 7,

1 = 2 x 4 – 7 = (2+7n) x 4 – (1 + 4 n) x 7

for any integer n.

So you can always vary the coefficients to get more solutions with the same result.

Exploration:

As noted earlier, when combining two numbers through addition and subtraction, the set of values you can produce is exactly the set of multiples of their greatest common factor (GCF).

  • If the GCF is 1, then you can create every integer—positive, negative, and zero.

  • If the GCF is greater than 1, then you can only produce multiples of that GCF.


Example: 4 and 6

  • The GCF of 4 and 6 is 2.

  • So, any combination of 4s and 6s (added or subtracted) will result in even numbers only.

    • That means odd numbers like 1, 3, 5, etc., cannot be formed.

  • This is easier to understand if you write 4 and 6 as:

    4=2×2,6=2×3

  • Now you’re combining multiples of 2 and 3—but everything is being scaled up by a factor of 2. That’s why you get all even numbers (multiples of 2), but not all numbers.


Conclusion

The set of numbers you can make using any two integers through addition or subtraction is completely determined by their greatest common factor:

  • If GCF = 1, you can make every number.

  • If GCF = d > 1, you can only make multiples of d.

This insight is especially useful in number theory, modular arithmetic, and Diophantine equations.