# Charlie's delightful machine

*You may wish to look at Shifting Times Tables before trying this problem.*

**Can you work out how to switch the lights on?**

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!**Start by exploring Level 1.** Type in some numbers and see which lights you can switch on.

To start again with a new set of rules, click the Level 1 button.**Can you develop a strategy to work out the rules controlling each light?**

Once you have a strategy, challenge yourself to find some four-digit numbers that turn on each light.

Once you are confident that you can work out the rules for Level 1 lights, have a go at A Little Light Thinking, where you can explore how to turn on several lights at once.*You may also wish to explore the Level 2 and 3 lights (which use a different type of sequence) in the same way. *

*You may also be interested in the other problems in our Cracking Codes Feature.*

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.

Vinay from Ripley Valley State Secondary College in Australia, Leala from Notredame in the UK, Tyler from Burnside Primary School in Australia and R from the UK worked out the rules for specific versions of the game. Every time you play, the rules are different, so people's answers are different. Here are some examples of the sets of 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:

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)

Shaunak from Ganit Manthan, Vicharvatika in India explained how to find the rules. You can read Shaunak's method below, or watch Shaunak's video by clicking here.

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.

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.

### 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

**Level 1 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.

While the class is working, note any particularly good ways of recording or working systematically, and highlight them to the rest of the class.

Bring the class together to share insights and conclusions before moving on to A Little Light Thinking, in which students are invited to find sequences that turn several Level 1 lights on simultaneously.

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.

### Possible extension

**Level 2 rules** are quadratic sequences of the form $an^2+bn+c$ with a=0 or 1**Level 3 rules** are quadratic sequences of the form $an^2+bn+c$ with a=0, 0.5, 1, 2 or 3.

Level 3 sequences can be used as a starting point for some detailed exploration into graphical representations of quadratic functions.