# What is the next number in the series: 21, 21, 23, 20, 5, 25, 31, 24,?

I came across a puzzle from a workbook for primary school students who wish to sit in exams for enrolling to selective high schools, which asks about what is the next number in the series.

1. What is the next number in the series?

21, 21, 23, 20, 5, 25, 31, 24, ?

(A) 3
(B) 10
(C) 17
(D) 86

(Original image)

I've thought many possibilities but none is satisfactory.

What is the next number?

• I understand the point of questions like this, but I've noticed that they tend to teach math students that sequences have to follow an obvious pattern. On the contrary, there are approximately 800 distinct, mathematically interesting sequences that feature 1,2,4,8,16 in that order. – Charles Hudgins Sep 30 '19 at 4:09
• @CharlesHudgins funny that you mention this given this recent question: puzzling.stackexchange.com/questions/89273/… – im_so_meta_even_this_acronym Sep 30 '19 at 4:51

I would expect the answer to be

A) 3

Because

If you look at how each term is reached from the last it looks like $$\times1,+2,-3,\div4,\times5,+6,-7$$ and if we were to continue this it would be $$\div8$$.
$$24\div8 = 3$$

• Thank you, Adam. I think that's how the sequence was made. – Michael May Sep 29 '19 at 11:01

A) 3

My reasoning

21=21*1, 23=21+2, 20=23-3, 5=20/4, 25=5*5, 31=25+6, 24=31-7. Each new term is generated by doing 'something' to the previous term. This something cycles between multiplication, addition, subtraction and division. Also the values used increase by 1. So the next number should be 24/8 = 3. Unfortunately this integer sequence breaks down the next time we need to divide as we have 26/12, which is not integer.

• Nobody said that all the elements in the sequence have to be integers. – phoog Sep 30 '19 at 6:48
• An interesting challenge would be to see if changing the starting number would allow you to continue the sequence for longer before getting a non-integer result. I suspect that you couldn't get too high because of that pesky divide step. There might be a proof somewhere that shows that such a sequence would always eventually break... – Darrel Hoffman Sep 30 '19 at 14:32
• @DarrelHoffman I wrote a program to check this. It turns out that we cannot get more than 9 steps before reaching a non-integer value. 9 steps occur when we start from $32n-11$, for any $n \geq 1$. – Dmitry Kamenetsky Oct 1 '19 at 0:42
• Could it possibly go for longer by changing the order of operations? There's 24 different ways of mixing them up, might take a while to try them all with a variety of different starting points. If we could somehow get a sequence that doesn't terminate so early, it might be worthy of the OEIS... – Darrel Hoffman Oct 1 '19 at 13:28
• @DarrelHoffman great minds think alike! I already did exactly what you suggested and created an OEIS sequence about it. It is still not approved, but it will be A327962. If you start with 27846 and alternate between /,+,-,* you can make 24 terms before you reach a non-integer. – Dmitry Kamenetsky Oct 2 '19 at 2:15

3
It is a sequence of addition, subtraction, division and multiplication

• Welcome to Puzzling. This appears to be correct, however the correct answer has already been posted above. – Alconja Sep 30 '19 at 4:59
• Also, you should avoid a one-line answer and explain how you came up with that answer. – Zoma Oct 1 '19 at 9:13