Charlie's delightful machine
Here is a machine with four coloured lights. Can you develop a strategy to work out the rules controlling each light?
Problem
You may wish to look at Shifting Times Tables before trying this problem.
Charlie's Delightful Machine has four coloured lights. Each light is controlled by a rule.
If you choose a number that satisfies the rule, the light will go on.
Some numbers may turn on more than one light!
Type in some numbers and see which lights you can switch on. Click on the purple cog if you want to keep a record of your results.
Can you work out how to switch the lights on?
Once you have a strategy, challenge yourself to find some three-digit positive numbers that turn on each light. How about some three-digit negative numbers?
How about a four-digit positive number and a four-digit negative number?
Once you are confident that you can work out the rules for the lights, have a go at A Little Light Thinking, where you can explore how to turn on several lights at once.
Getting Started
You could start by exploring Shifting Times Tables to get a feel for the sequences that turn on the lights.
Try exploring just one light at a time.
Student Solutions
We received lots of detailed solutions to this problem - well done to you all!
As some of you noticed, the rules are different every time you play. This means that people's answers are different, but most of the strategies used in the submitted solutions would work for any cases the computer generated.
Tyler from Burnside Primary School in Australia, Leala from Notredame, Jenny from Tapton Secondary School and Joseph and Jack from Eden Primary, all in the UK, worked out the rules for specific versions of the game they played. Here are some examples of the ways they expressed the rules they found.
Tyler:
Blue light turned on by repeating pattern of adding 2 starting from 1 so the pattern is 1,3,5,7,9,11 and so on.
Yellow is every 3 starting from 2, so 2, 5 8, 11, 14, 17,20 etc.
Green is every 9 starting from 2, so 2, 11, 20, 29, 38, 47 etc
Red is every 8 starting from 5, so 5, 13, 21, 29, 37, 45 etc.
Leala also described the rules in words and also using algebra:
Yellow- multiples of 3
Red- going up in 8 them minus 2 (8$n$-2)
Blue- going up in 8 then minus 5 (8$n$-5)
Green- going up in 6 and then minus 2 (6$n$-2)
Jenny described a similar pattern for her rules using ideas from Shifting times tables:
The yellow light lights up on numbers 6 and 17. Because these are all linear sequences - the differences between all of the terms are the same - we can deduce the shifted times tables by finding the difference between two terms. 17-6=11, so our yellow light turns on in shifted 11 x tables [shifted by 6]
Jenny explained using a similar approach that the red light in her game was turned on by numbers in a 10 x table shifted by 3, the green light was turned on by numbers in the 11 x table shifted by 5, and the blue light was turned on by numbers in the 8 x table shifted by 0.
Joseph and Jack described the rules they found and their approaches:
Our tactic at first was simply go through numbers slowly and try to find patterns in the lights one at a time. The solution for the yellow light was just even numbers.
The next colour was green, and, once again, using the same idea, we found the answer (odd multiples of three), relatively easily.
Blue and red were a step up in difficulty, as they were multiples of numbers subtracted by a certain number of integers.
Joseph and Jack realised that they needed to work more systematically for these harder rules and found algebra helped to make this problem simpler. The rules they found were:
Red was 11X-1, whereas blue was 7X- 2.
Like Jenny, Leala, Joseph and Jack and many other students who submitted solutions, Shaunak from Ganit Manthan, Vicharvatika in India found algebraic rules for each light. Shaunak explained in detail how they found the rules and you can watch Shaunak's video. (Although this used an older version of the interactivity, the strategy still works).
You could also read Shaunak's strategy:
Here is a strategy to work out the rules controlling the lights:
1: Find the rules for the Yellow light - Start by keeping zero in the box. Keep on increasing the number in the box by one. Note down the first 5 numbers that satisfy the rule for the Yellow light.
Next, find the difference between any two consecutive numbers in this list. Call this difference $n.$
Then, find the remainder obtained by dividing any number from this list [by $n$]. Call this number $b.$
The rule is - Numbers $b$ more than [a multiple of] $n.$
So, any number that can be expressed as $a\times n + b,$ where $n$ and $b$ are those computed above, and a is any number, satisfies the condition for the Yellow light.
In a similar manner, one can find the rules for the Red, Blue and Green lights. These three also follow the $a\times n + b$ property.
Example:
I started with 0. The first five numbers that satisfy the rule for the Yellow light are - 2, 5, 8, 11, and 14.
Now, I need to find $n,$ which is the difference between two consecutive numbers in this list. 2 and 5 are consecutive numbers in this list, so
$n$ = 5 - 2 = 3
Next, I should find $b$, which is the remainder obtained by dividing $n$ by any number in this list. Because 11 is a number in the list, and $n$ is 3, so the remainder obtained is 2 (from 11$\div$3).
The rule is - Numbers 2 more than multiples of 3.
So, any number that can be expressed as 3$a$ + 2, satisfies the above rule.
If $a$ is 343, I will get a number larger than 999, or a 4-digit number.
Let me put $a$ as 343 and see if the Yellow light gets switched on...Yes! It worked!
Using the same strategy one can find the rules and properties for Red, Blue and Green lights.
Saul from Eden Primary and Nilaa from Hymers College in the UK noticed a pattern when they described their rules. Here's Nilaa's explanation:
For the blue bulb, the numbers were 1, 10, 19, 28, 37, and 46. As you can see, each number has a difference of 9 in between them. To fill out the answer pop-up [within the interactivity], you had to check the gaps (for blue it was a gap of 9) and then put the number 9 in the 2nd and 4th boxes. The 2nd and 4th boxes are always the same. After, you need to work out how much less or more the number has to be to light up the bulb. For the blue one for me, it was the number had to be 1 more than a multiple of 9 or 8 less than a multiple of 9. 1 + 8 = 9 and this was the same situation for all the bulbs I completed. That means you only have to work out one of those two boxes to work out the other.
Does Nilaa's argument also work for each of these rules from Leo at The English School?

Several people mentioned was how many numbers they tried before finding the rule for each light: some people tried 1-99 and someone else suggested 25. Sophie and An from Australia tried enough so that they had 3-5 numbers for each bulb:
The way we figured out the solution to Charlie's delightful machine was we recorded 3-5 numbers that lit up the bulb. Then, we found the difference between each number (e.g. 5 8 11 14 diff = 3). Next, find the closest multiple with the difference amount.(e.g. 3 is the closest to 5, answer 2 more than a multiple of 3).
This made us wonder how many numbers you actually need to try to find the rules - and how this might depend on the particular set of rules.
Several of you attempted the later part of the problem and tried to find three-digit and four-digit positive and negative numbers that would light up each of the bulbs. Some solutions gave one example of each, or used trial and improvement for this. Gautam from Doha College in Qatar used inequalities to get a full set of solutions and explained their approach very clearly. Here's one example for a light that is turned on by numbers of the form $4n+3.$
To make a 3-digit positive number with the equation $4n+3$
$100\leq 4n+3 \leq 999$
We can subtract $3$ from each section of the equation and get,
$97\leq 4n \leq996$
Divide all terms by $4$ and get
$24.25\leq n\leq 249$
Since $n$ has to be an integer, it should be in the range of 25 to 249 inclusive.
If you just put $n$ in the equation, you will get a 3 digit integer.
For example: $4(25)+3=103.$
Eric and Sunny from Dulwich College Beijing, Ci Hui from Queensland Academies for Science Mathematics and Technology, Australia, and Alex and Enzo from Harrow International School Hong Kong took this problem further and tried to find numbers that would light up more than one bulb at once, which connects with A little light thinking.
Enzo made the following observation for the rules they were working with:

So far, in all the attempts I tried, I was unfortunately unable to find a number that lights up all four lights. For instance, the red and blue lights cannot light up at the same time because the red light only lights up when the number ends in a 4, and the blue light only lights up when it ends in 6. The number cannot end in 4 and 6 at the same time.
Ci Hui represented the numbers that light up each bulb in a number grid and noticed a similar idea to Enzo.

Alex also sent in detailed work on the problem of turning on all lights for the set of rules they'd found. You can read Alex's detailed work, but you might like to have a go at this problem for yourself first.
Thank you to everyone who sent in solutions and shared their approaches and observations about this problem.
Teachers' Resources
Why do this problem?
Many standard questions give exactly the information required to solve them. In this problem, students are encouraged to be curious, to go in search of the information they require, and to work in a systematic way in order to make sense of the results they gather.
The problem could be used to reinforce work on recording and describing linear and quadratic sequences.
Possible approach
This task will require students to have access to computers. If this is not possible, Four Coloured Lights provides students the opportunity to make sense of numerical rules without the need for computers.
- Odd numbers
- Numbers which are 1 more than multiples of 4
- Numbers which are 2 less than multiples of 5
- Numbers which are 3 more than multiples of 7
All the rules are linear sequences of the form $an+b$, with a and b between 2 and 12.
Students could then work in pairs at a computer, trying to light up each of the lights. Challenge them to develop an efficient strategy for working out the rules controlling each light.
Bring the class together to share insights and conclusions.
Key questions
Which numbers will you try first?
Can you suggest a number bigger than 1000 that you think will turn on the light?
Possible support
Shifting Times Tables offers students a way of thinking about linear sequences and opportunities to explore how they work.
Students could use a 100 square to record which lights turn on for each number they try.