The first step that we can do is to write out the numbers that make each coloured light turn on in order, as it allows us to recognise patterns easier.
An important thing to recognise when looking at patterns is that they almost always have a logical sequence, which you can quite easily find an nth term in.
The nth term of a sequence is a formula that allows you to find any term in the sequence based on its position, which is represented by the letter n. Essentially, it helps you determine the value of the term at the nth position without having to list out all the terms before it.
For example, if the nth term of a sequence was, '2n + 3', you could substitute any number into n, such as 3, and it would give you a number in the sequence, in this case being (2 x 3) + 3, which is 9.
For this problem, every term in the sequence for each light is a number that will turn the light on. Starting with the red light, we can see that it turns on when a multiple of eight is input, so an nth term isn't required for further working. Similarly with the blue light, which turns on when a multiple of 7 is input, an nth term isn't required.
However, for the yellow and green light, we need to work out an nth term to be able to predict all other integers that will work, and turn the light on.
Starting with the yellow light, we first need to work out if the distance between the terms is the same throughout. Thankfully for us, the difference between each term is constant, with each number being 6 apart. This means that the nth term is 6n + another number, as the numbers in the sequence aren't multiples of 6.
To work this number out, lets look at the first number in the sequence, that being 2. The first multiple of 6 is, well, 6, so we need to work out what to do to 6 to get to 2. Easily enough, all you have to do is take away 4 to get the desired number, and this is the same for all other numbers in the sequence with their respective multiple of 6. This means our nth term for the yellow light is 6n - 4.
Now for the green light. Each number in the sequence has a difference of 4, so we know that the nth term is 4n + another number. Looking at the first term, 3, all you have to do is take 1 away from 4 to get the desired number, meaning our nth term is 4n - 1.
Now, instead of keeping these formulas, lets rewrite them. We can say for the yellow light, that each integer to turn the light on is 4 less than a multiple of 6, and for the green light, 1 less than a multiple of 4.
Which leads us to our final answer:
The red light requires a multiple of 8 to be input for it to be turned on.
The yellow light requires a number 4 less than a multiple of 6 to be input for it to be turned on.
The green light requires a number 1 less than a multiple of 4 to be input for it to be turned on.
The blue light requires a multiple of 7 to be input for it to be turned on.