# Pattern and Sequence Puzzles Revisited

Back in May, I wrote about pattern and sequence puzzles, and didn’t have the space to cover all that I would have liked. It’s time to revisit the topic, looking at a couple different types of sequences, and then the “input/output” or “function” puzzles that add an extra twist to the idea.

## Alternative methods

We’ll start with a question like the sequence puzzles from last time:

Finding a Formula for a Number Pattern

I am in a geometry class and we are learning about sequences and how to find the patterns in numbers.  I was fine up until our teacher wrote this up on the board:

0, 3, 8, 15, 24, 35

She told us that we had to use factoring to find this answer.

What is confusing about this question is I don't know how to get from the problem to the answer that was given:

(n+1)(n-1)

How did my teacher get this?

I know from this problem that the whole pattern is that you add by odd numbers (like to get from 0 to 3 you go by 3, to get from 3 to 8 you go by 5, 8 to 15 you go by 7, etc).  But I can't see how to get that other answer.

Sometimes there is only one way to solve a problem; but it’s an overstatement to say that we “have to use factoring” here. That was really a hint for one way to do it. What Kelly has done is good, and we’ll get to that soon; it just doesn’t follow the hint.

I responded, following the hint:

The hint says to factor the numbers in the sequence:

0, 3, 8, 15, 24, 35

0, 3, 2*2*2, 3*5, 2*2*2*3, 5*7

What if we look for a way to factor each number into TWO factors so that they all look similar? Here is what I come up with:

0, 1*3, 2*4, 3*5, 4*6, 5*7

When I saw this, I just noticed that the pattern was one of multiplying a pair of numbers where both increase by one each time, with the first number going 1,2,3... and the second going 3,4,5..., etc..

The pattern wasn’t obvious until we had “played” with it for a while, looking for a way to factor the numbers that looked like a pattern. Prime-number factoring was just a start, to help me see possibilities. Even then, there are several ways to describe this pattern; I described it as the product of two separate sequences, but we could also say each term is the product of two numbers that differ by 2.

Now we have to turn the pattern into a formula. (Or do we? The problem as presented just said to find a “pattern”, which need not be represented by a formula.)

One helpful way to organize your thoughts is to make a chart of the pattern and include the index, or the number of the result in the pattern.  Then you can see if there is a consistent relationship between the pattern and the index.  In this case, you can see that the first number is always one less than the index, and the second is one more:

index  term
-----  ----
1    0*2
2    1*3
3    2*4
4    3*5
5    4*6
6    5*7
n    (n-1)*(n+1)

The second term is 2-1 times 2+1, the third is 3-1 times 3+1, and so on.  Seeing that this pattern applies to all the terms, the formula for the sequence is

a[n] = (n-1)(n+1)

(Of course, any answer is really just a guess--this is a nice formula, so we assume it is what was intended, but in real life sequences aren't always nice!)

Kelly asked how the teacher got it; there are a couple possibilities, but the reality is that it was almost certainly done in reverse:

How did the teacher get it?  Probably because she or whoever invented the problem STARTED with (n-1)(n+1) and wrote out that sequence! Solving problems like this is very different from making them up.  You couldn't just write down any random sequence and then figure out "the pattern" to it; random numbers don't generally have any pattern.  The pattern is there because someone deliberately made it that way.

But now let’s go back to Kelly’s own idea, which was better than she knew. It just doesn’t directly provide a formula:

Now, you seem to have come up with a perfectly good alternative answer, using a standard technique of looking for a way to get from one term to the next.  The sequence of differences is

0, 3, 8, 15, 24, 35

3, 5, 7,  9, 11

and that pattern is clear enough that you know how to find as many terms as you want.  That's a fine answer, unless you were asked to find an explicit formula, which means you can find any term in the sequence by calculating it directly and not having to work your way through the sequence all the way to the desired term.  How could you work your pattern into an explicit formula?

There are general techniques for turning a recursive pattern into an explicit formula, but they are rather advanced. I showed my own way to see it in this case:

I happen to know that the sum of consecutive odd numbers is a square:

1 + 3 = 4
1 + 3 + 5 = 9
1 + 3 + 5 + 7 = 16

and so on.  The formula for this is

1 + 3 + 5 + ... + (2n-1) = n^2

Your sequence is just my sum with 1 removed from the start! So the formula is

a[n] = n^2 - 1

Check that: if we add 1 to each term of your sequence, we get

0, 3, 8, 15, 24, 35

1, 4, 9, 16, 25, 36

(In fact, that is another way one could find the answer!)

And this new formula is equivalent to the one you were told, since the difference of squares n^2 - 1 factors as (n-1)(n+1).

Interesting, isn't it? There are a lot of ways to solve this one, and they all give the same answer.

The fact that the sum of consecutive odd integers is a square is explained here:

Summing Odd Numbers Geometrically
Sum of First n Odd Numbers

There is also an algebraic method for finding the formula, starting with Kelly’s observation about the differences, which is explained here:

Method of Finite Differences

## Alternating patterns

Now let’s look at a much more complicated-looking sequence:

Sequence Uncertainty

I need help understanding how to complete series. For example,

1, -4, 8, 3, -6, -11, 22, 17, ...

I thought that the next number was 4, but I feel that it is the wrong answer.

I thought that finding a common pattern would help. I started to subtract pairs of consecutive numbers in turn until a common number was found, but ran afoul. So I'm not sure if this is a good way to find a solution. These kinds of things just don't seem to have any defined pattern to them.

This is not a homework assignment; it's just irking me that I can't find anything online that helps me understand how these are solved.

This looks like a very challenging sequence, with the terms varying wildly. It will not be as easy as those we have seen so far!

I started with my usual caveat, and a vocabulary reminder:

First, you need to know that there is no general technique for "solving" these. Unless you are told something about what pattern to expect, they are just puzzles or guessing games.

You should also know that this is not a "series" (terms to be added together), but rather a "sequence" (a list of terms). Specifically, you are looking for a pattern. A sequence need not have any pattern at all, much less a formula that defines it; and even "pattern" has no specific definition. So it's natural that these problems can be hard. They should be thought of as puzzles to enjoy, not as tests of a specific skill you should have. Some require thinking outside the box; others require just having seen enough of the tricks people can use to make them hard.

Now we have to look at the details:

When the terms of a sequence are as variable as these, I tend to expect that the rule that generates terms may itself vary. A common trick is to alternate between two rules, or even between two unrelated sequences. Here, if I do what you did and look at successive differences between terms, which is a useful way to start, I see something interesting:

1    -4    8    3    -6    -11    22    17
-5    12   -5   -9    -5     33    -5

Every other difference is -5! So it looks like the rule will be "subtract 5, then ..."

Successive differences can be a powerful tool, as I mentioned above (and will talk about more in the future); but they can reveal different things. Here, it is the alternation between -5 and something else that provides the clue. We subtract 5 from the first term and get -4; then we do something else and get 8; then we subtract 5 again and get 3; and so on. So we now have a new puzzle: find the “something else” that changes -4 to 8, 3 to -6, and so on.

Now, is there a pattern in the other steps? 12, -9, 33 doesn't look promising; but (from my past experience) it wouldn't surprise me if the other rule involves multiplication or something else.

Let's look at the pairs of numbers we have to relate:

1
-4    8
3   -6
-11   22
17

Ah! Can you see what's done to each term in the first column to get the one in the second? Do that to 17, and you'll have the next term.

The basic technique of doing what you can, then looking at the result and finding something else you can do pervades math, and problem-solving in general. (For example, to simplify a fraction, you find a common divisor and divide by it, then sit back and look at the result to see if there is another common divisor.) Here, listing the input and output of the “something else” at each step gave us a sub-puzzle that was manageable.

That's the kind of thinking I go through. Sometimes I need a lot more tries, and couldn't merely write as I think through it, as I just did.

Sean replied:

Thank you so much for answering this question. I never thought I would completely understand how to find an answer but a light bulb came on after I read your second paragraph.

It’s also worth noting that we weren’t asked for a formula for the nth term; that would be quite difficult. We just had to identify the pattern (in this case, an alternating recursive pattern) and apply it to a term or two.

## Inputs and outputs

Now let’s turn to a related type of problem, where there will be a formula, but what we are given is not a sequence (successive terms) but a function (outputs for non-sequential inputs). The second half of the pattern above had to be found this way.

Finding a Rule That Fits an Input-Output Problem

My daughter has this input/output problem:

Input        Output
12           10
16
32
62           35
70           39
86

She has to state the rule and fill in the missing numbers.  These numbers do not seem to line up in a pattern.  I don't have a clue where to even begin.

Here we have been given three random “inputs” for which we know the “output”; we have to write a formula for the output as a function of the input, and then apply it to the two missing numbers. This is a very open-ended problem if there are no constraints on the kind of formula we can expect, so I started with a wish for more context:

The first step in your strategy, I think, would be to find out from your daughter what kinds of "rules" they have been using, perhaps looking at examples from her text or worksheets.  For me, unable to do that, the puzzle is a lot harder--in general, there are infinitely many possible "patterns" one could choose, so with no context it's just a guessing game.  And I see some puzzles that look a lot like this one with much different rules.

This one turns out to be a reasonably simple kind that I would have hoped for:

But I've seen enough of these to know that for younger children, typically the rule involves one or two operations, often an addition and a multiplication (which, in algebra, would be called a linear function, but here might be called a "two-step rule" or something like that).

I don't know whether teachers present any specific strategy, or just expect children to make a lot of guesses (maybe based on the examples they've seen) and so get in a lot of arithmetic practice while trying out ideas.  But I have found a very useful strategy.

This strategy is equivalent to one taught in algebra classes for finding the equation of a line (finding the slope, then solving for the y-intercept); but there is no need to introduce those concepts.

The idea behind it is that if you multiply by something and then add something to the result (algebraically written as "y = ax + b"), then CHANGES in x are multiplied by the same thing, and the addition doesn't affect the change.  For example, if the pattern were y = 4x+3, then when x=2, y=11, and when x=5, y=23.  The difference between 2 and 5 is 3; the difference between 11 and 23 is 12, which is 4 times as much.  The fact that we added 3 to each product doesn't affect the change.  So we can find the multiplier by comparing the differences. In your example, you might make a table like this (looking only at the lines in which both numbers are known):

Input Change Output Change
12           10
62    50     35     25
70     8     39      4

That is, 62-12 = 50 (the change in the input), and 35-10 = 25 (the change in the output for the same pair).

Notice that the change in the output is always half the change in the input.  That tells us that the multiplier is 1/2.  So the rule starts with "multiply by 1/2" (which is the same as "divide by 2").

Can you see how to find the rest of the rule?  See if you can work it out.

I gave links to one of the answers I showed in May, and to the next one we’ll look at. These fill in the next step in the process. I also added an alternative method:

To tell the truth, I initially solved this one by a slightly different method.  I focused my attention on the biggest example, 70 -> 39, and looked for the closest simple multiplier.  Since half of 70 is 35, it was a good guess that the rule might be to take half, and then add 4. Then I just checked the other examples to see whether that worked for all of them.  The idea behind this method is that multiplication by big numbers "swamps" any addition; so you can see the multiplicative behavior by looking at big numbers.  That's an insight that comes from years of experience; but kids might be able to see it too.

I call this the hopeful-guess strategy; it has no guarantee, but sometimes can be faster.

## Another two-step pattern

Here is the question I referred Diane to, asked by “Mrs. C” in 2003:

Multi-Step Patterns

My daughter has been working using tables to find patterns.  Here is an example problem.

Find the rule that will give the second number if you know the first.  Then fill in the rest of the table according to the rule.

2/7
3/10
5/16
8/?
22/?
?/22

I thought: 2+5=7, and 3+7=10, but I don't know where to go from there.

At first I’m sure I thought this was about fractions, but that’s a table. She was focusing on what is added to the input; but here there will be two steps, in which case, as noted above, I find it better to start with the differences between outputs:

This kind of problem is really a tricky puzzle that can only be solved by guesswork and intuition. You don't have to feel bad about not being able to do it; and I hope it is not assigned as if everyone should be able to figure it out!

You are probably looking for one possible type of pattern, namely that the same number is always added. The actual pattern is a little different. One way to discover it is to look at the differences between numbers:

x      y
-     --
2 -->  7
3 --> 10    increasing by 1 increased result by 3
5 --> 16    increasing by 2 increased result by 6

As before,  comparing the increase in the output to the increase in the input (which in algebra will be called the slope) gives us a key fact:

The result seems to increase by 3 times as much as the number you put in; so there must be multiplication by 3 going on somewhere. Suppose we assume that the first step is multiplying by 3, and then compare 3 times the input with the output:

x     3x      y
-     --     --
2 -->  6 -->  7
3 -->  9 --> 10
5 --> 15 --> 16

Can you see how 3 times x and y are related? This means that the pattern takes two steps, first multiplying and then adding. That's not easy to see if you haven't seen a lot of these, as I have. (If your daughter has seen enough of them, and knows what kind of pattern to expect, then it makes sense to assign this problem; but the teacher needs to make the connection clear, and not just drop this puzzle on them out of thin air.)

There's some more work left to do, but this solves the hardest part
of the problem.

We can see by comparing the 3x column with the y column that we have to add 1; so the formula is $$y = 3x + 1$$.

For more general ideas about input-output puzzles, see this by Doctor Ian:

Finding Input-Output Rules

This site uses Akismet to reduce spam. Learn how your comment data is processed.