Answer: What Comes Next? #396

The answer is D: 28.

The finished pattern: 1, 3, 6, 10, 15, 21, 28.
The finished pattern.

The rule

These are triangle numbers. Add 1, then 2, then 3, then 4… You can stack that many dots into a triangle.

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.

total = 0
for n in range(1, 8):
    total = total + n
    print(total)

When you run it, Python prints:

1
3
6
10
15
21
28

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