$\begingroup$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.$\endgroup$
– Charles HudginsSep 30 '19 at 4:09

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.

$\begingroup$Nobody said that all the elements in the sequence have to be integers.$\endgroup$
– phoogSep 30 '19 at 6:48

3

$\begingroup$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...$\endgroup$
– Darrel HoffmanSep 30 '19 at 14:32

3

$\begingroup$@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$.$\endgroup$
– Dmitry KamenetskyOct 1 '19 at 0:42

2

$\begingroup$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...$\endgroup$
– Darrel HoffmanOct 1 '19 at 13:28

2

$\begingroup$@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.$\endgroup$
– Dmitry KamenetskyOct 2 '19 at 2:15