Associated Topics || Dr. Math Home || Search Dr. Math

### Finding Formulas for Number Sequences

```
Date: 11/22/97 at 02:10:07
From: Ricky Chu
Subject: Formula

Hi Gentleman,

My question is about trying to find a formula between numbers. For
example, suppose I have 10 numbers: 2, 4, 6, 8, 10, 12, 14, 16, 18, 20
It is obvious that the first number plus 2 will yield the second
number, 4; 4 plus 2 will yield the number 6, and so on. So the formula
for this group of numbers is x + 2.

Say I have another set of numbers: 2, 6, 14, 30, 62.....
If the first number is multiplied by 2 and 2 is then added, you will
get 6. 6*2 + 2 will yield 14. 14*2 + 2 will be 30.. So the formula is
x*2 + 2.

The above two examples are very simple. The formula can be found by
observation. However if I have a group of numbers like 13, 80, 145,
167, 188... Those numbers look random but they are related. Do you
have any idea how to find the formula? I only want to know the method.
I have tried to use the difference equation, but it doesn't work.

Best Regards,

Ricky.
```

```
Date: 11/22/97 at 05:40:52
From: Doctor Mitteldorf
Subject: Re: Formula

Dear Ricky,

Finding numbers from a formula is a science. You can even program a
computer to do it. But finding a formula from numbers is an art.
You try this and you try that, and with a little luck you're sometimes
successful.

You've mentioned differences: taking successive differences is a
powerful way to give you insight into the formulas behind many
sequences. Taking ratios of successive terms, dividing each by the
previous one, is another technique.

Remember that there's no one "right answer" for finding a formula to
match a sequence of numbers. That's because there are a lot more
formulas than there are sequences, and you can always find several
formulas that work. In test questions, there's usually one that
"seems" simplest, and that's what they're looking for; but it's not

Here's one "brute force" way that will always generate a formula, but
it might not be the "simplest" formula. If you have 5 numbers in the
sequence, they can be matched by an expression of the form:

a + bn + cn^2 + dn^3 + en^4

Just write down the 5 equations and solve for a,b,c,d and e. For the
sequence you suggested, the n=0 term is 13, so a=13. The next term is
n=1, so
a + b + c + d + e = 80

The next term is n=2, and the corresponding equation is

a + 2b + 4c + 8d + 16e = 145

Try writing down the other two equations and solving them all
together. You'll get a formula for sure, but it may not be the
simplest or most satisfying one.

-Doctor Mitteldorf,  The Math Forum
Check out our web site!  http://mathforum.org/dr.math/
```

```
Date: 11/24/97 at 01:34:26
From: RICKY CHU
Subject: Further problem on formula

Dear Doctor Mitteldorf,

Thanks for your help and ideas. I have tried your suggestion to find
out a formula, but this is not the one that I want. I used a group of
numbers, say 10, 18, 34, 66, 130. The formula is (x * 4 + 2) / 2 - 3.
That formula can be simplified as (x * 2 - 2).

If I use your suggested solution:

a + b*n + c*n^2 + d*n^3 + e*n^4 = 10,

a = 10;
b = 14/3;
c = 11/3
d = -2/3;
e = 1/3;

I agree with you that there are many formulas to generate the same
result. My further problem is I have to use the existing data to
forecast/predict the following numbers. If I use the above approach, I
can't find the following numbers. How do I know the number next to
130?

Do you have any idea to find the mentioned formula or any book that
you can refer me to?

Best Regards,

Ricky.
```

```
Date: 12/03/97 at 04:51:21
From: Doctor Mitteldorf
Subject: Re: Further problem on formula

Dear Ricky,

The solution you found is certainly simpler and more elegant than
mine.

You can always match a list of 5 numbers with a formula that has 5
free parameters in it (a b c d e). Your formula has only 2 free
parameters and it works - but this is a measure of 1) the fact that
your formula is "better," and 2) that there really is a pattern in

A geometric sequence is one in which each number is a constant times
the previous number. They are not hard to detect. But your sequence is
"almost geometric." I suppose the best way to detect it is to notice
that each number is close to twice the last, and that might inspire
you to play with the disparity.

In general, pattern recognition is an art as well as a science.
With experience, you just get better at it. Does the sequence in your
question come from "real" data, or is it a made-up problem?  For
made-up problems, it's anyone's guess; but if the sequence comes from
some scientific or mathematical source, the source must be considered
a valuable clue to what kind of pattern to expect.

You can search for resources on this topic under "pattern recognition"
and under "sequences". Both terms are subject to lots of distraction:
"pattern recognition" is also used to describe the process of
recognizing images, like people's faces, etc, from a collection of
dots. "Sequences" can also describe the area of mathematics that
relates to summation of infinite lists of numbers.

Here are two resources I turned up with a search:

Andrews, Harry C. Introduction to Mathematical Techniques in Pattern
Recognition. Malabar, FL: Krieger, 1983. 242 pp.

Sloan's On-Line Encyclopedia of Integer Sequences
http://www.research.att.com/~njas/sequences/index.html

-Doctor Mitteldorf,  The Math Forum
Check out our web site!  http://mathforum.org/dr.math/
```
Associated Topics:
College Discrete Math
College Number Theory
High School Discrete Mathematics
High School Number Theory

Search the Dr. Math Library:

 Find items containing (put spaces between keywords):   Click only once for faster results: [ Choose "whole words" when searching for a word like age.] all keywords, in any order at least one, that exact phrase parts of words whole words

Submit your own question to Dr. Math
Math Forum Home || Math Library || Quick Reference || Math Forum Search