Answer: What Comes Next? #362

The answer is D: 36.

The finished pattern: 9, 10, 18, 19, 27, 28, 36.
The finished pattern.

The rule

Add 1, then add 8, then 1, then 8, and so on. The pattern of adding takes turns.

The pattern as Python code

Here is a tiny Python program that follows the same rule. Type it into IDLE and run it to print the whole pattern, including the answer.

adds = [1, 8]
number = 9
for step in range(7):
    print(number)
    number = number + adds[step % 2]

When you run it, Python prints:

9
10
18
19
27
28
36

Pixel says: Try changing a number in the code and run it again. Can you make the pattern go on for 20 steps? Meow!