<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />

# Recursive Formulas

## Where a term is based on prior term(s) in a sequence.

Estimated20 minsto complete
%
Progress
Practice Recursive Formulas
Progress
Estimated20 minsto complete
%
Recursion

When you look at a pattern, there are many ways to describe it. You can describe patterns explicitly by stating how each term ak\begin{align*}a_k\end{align*} is obtained from the term number k\begin{align*}k\end{align*}. You can also describe patterns recursively by stating how each new term ak\begin{align*}a_k\end{align*} is obtained from the previous term ak1\begin{align*}a_{k-1}\end{align*}. Recursion defines an entire sequence based on the first term and the pattern between consecutive terms. The Fibonacci sequence is a famous recursive sequence, but how is it represented using recursion?

0,1,1,3,5,8,13,21,34,\begin{align*}0,1,1,3,5,8,13,21,34, \ldots\end{align*}

### Finding Terms with Recursion

When most people see a pattern they see how consecutive terms are related to one another. You might describe patterns with phrases like the ones below:

 Pattern Recursive Description 3,6,12,24,…\begin{align*}3,6,12,24, \ldots\end{align*} “Each term is twice as big as the previous term” 3,6,9,12,…\begin{align*}3,6,9,12, \ldots\end{align*} “Each term is three more than the previous term”

Each phrase is a sign of recursive thinking that defines each term as a function of the previous term.

ak=f(ak1)\begin{align*}a_k=f(a_{k-1})\end{align*}

In some cases, a recursive formula can be a function of the previous two or three terms. Keep in mind that the downside of a recursively defined sequence is that it is impossible to immediately know the 100th\begin{align*}100^{th}\end{align*} term without knowing the 99th\begin{align*}99^{th}\end{align*} term.

In order to write a recursive definition for a sequence you must define the pattern and state the first term.  With this information, others would be able to replicate your sequence without having seen it for themselves. Take the following sequence:

3,7,11,15,18,\begin{align*}3,7,11,15,18, \ldots\end{align*}

The first term is : a1=3\begin{align*}a_1=3\end{align*}

Notice that each of the following terms increases by 4 so the recursive piece of the sequence is : ak=ak1+4\begin{align*}a_k=a_{k-1}+4\end{align*}. Putting the two together gives you the recursive definition of the sequence:

a1=3\begin{align*}a_1=3\end{align*}

ak=ak1+4\begin{align*}a_k=a_{k-1}+4\end{align*}

A recursive definition must always have two parts, the base case(the starting number) and the recursive case (the pattern to get more terms). Note that the base case may include more than one statement as is the case with the Fibonacci sequence.

### Examples

#### Example 1

The Fibonacci sequence is represented by the recursive definition:

a1=0\begin{align*}a_1=0\end{align*}

a2=1\begin{align*}a_2=1\end{align*}

ak=ak2+ak1\begin{align*}a_k =a_{k-2}+a_{k-1}\end{align*}

The first eleven terms and the sum of these terms is:

0+1+1+2+3+5+8+13+21+34+55=143\begin{align*}0+1+1+2+3+5+8+13+21+34+55=143\end{align*}

#### Example 2

What are the first nine terms of the sequence defined by:

a1=1\begin{align*}a_1=1\end{align*}

ak=1k+1?\begin{align*}a_k =\frac{1}{k}+1?\end{align*}

1,2,32,53,83,138,2113,3421,5534\begin{align*}1, 2, \frac{3}{2}, \frac{5}{3}, \frac{8}{3}, \frac{13}{8}, \frac{21}{13}, \frac{34}{21}, \frac{55}{34}\end{align*}

#### Example 3

The Lucas sequence is like the Fibonacci sequence except that the starting numbers are 2 and 1 instead of 1 and 0. What are the first ten terms of the Lucas sequence?

2,1,3,4,7,11,18,29,47,76\begin{align*}2,1,3,4,7,11,18,29,47,76 \end{align*}

#### Example 4

Zeckendorf’s Theorem states that every positive integer can be represented uniquely as a sum of nonconsecutive Fibonacci numbers. What is the Zeckendorf representation of the number 50 and the number 100?

50=34+13+3; 100=89+8+3\begin{align*}50=34+13+3;\ 100=89+8+3\end{align*}

#### Example 5

Consider the following pattern generating rule:

If the last number is odd, multiply it by 3 and add 1.

If the last number is even, divide the number by 2.

Repeat.

Try a few different starting numbers and see if you can state what you think always happens.

You can choose any starting positive integer you like. Here are the sequences that start with 7 and 15.

7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1\begin{align*}7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1\ldots \end{align*}

15,46,23,70,35,106,53,160,80,40,20,10,5,16,8,4,2,1,4,2,1\begin{align*}15,46,23,70,35,106,53,160,80,40,20,10,5,16,8,4,2,1,4,2,1\ldots\end{align*}

You could make the conjecture that any starting number will eventually lead to the repeating sequence 4, 2, 1.

This problem is called the Collatz Conjecture and is an unproven statement in mathematics. People have used computers to try all the numbers up to 5×260\begin{align*}5\times2^{60}\end{align*} and many mathematicians believe it to be true, but since all natural numbers are infinite in number, this test does not constitute a proof.

### Review

Write a recursive definition for each of the following sequences.

1. 3,7,11,15,19,\begin{align*}3,7,11,15,19,\ldots\end{align*}

2. 3,9,27,81,\begin{align*}3,9,27,81,\ldots\end{align*}

3. 3,6,9,12,15,\begin{align*}3,6,9,12,15,\ldots\end{align*}

4. 3,6,12,24,48,\begin{align*}3,6,12,24,48,\ldots\end{align*}

5. 1,4,16,64,\begin{align*}1,4,16,64,\ldots\end{align*}

6. Find the first 6 terms of the following sequence:

b1=2\begin{align*}b_1=2\end{align*}

b2=8\begin{align*}b_2=8\end{align*}

bk=6bk14bk2\begin{align*}b_k =6b_{k-1}-4b_{k-2}\end{align*}

7. Find the first 6 terms of the following sequence:

c1=4\begin{align*}c_1=4\end{align*}

c2=18\begin{align*}c_2=18\end{align*}

ck=2ck1+5ck2\begin{align*}c_k =2c_{k-1}+5c_{k-2}\end{align*}

Suppose the Fibonacci sequence started with 2 and 5.

8. List the first 10 terms of the new sequence.

9. Find the sum of the first 10 terms of the new sequence.

Write a recursive definition for each of the following sequences. These are trickier!

10. 1,4,13,40,\begin{align*}1,4,13,40,\ldots\end{align*}

11. 1,5,17,53,\begin{align*}1,5,17,53,\ldots\end{align*}

12. 2,11,56,281,\begin{align*}2,11,56,281, \ldots\end{align*}

13. 2,3,6,18,108,\begin{align*}2,3,6,18,108,\ldots\end{align*}

14. 4,6,11,18,30,\begin{align*}4,6,11,18,30,\ldots\end{align*}

15. 7,13,40,106,292,\begin{align*}7,13,40,106,292,\ldots\end{align*}

To see the Review answers, open this PDF file and look for section 12.1.

### Vocabulary Language: English

common difference

Every arithmetic sequence has a common or constant difference between consecutive terms. For example: In the sequence 5, 8, 11, 14..., the common difference is "3".

common ratio

Every geometric sequence has a common ratio, or a constant ratio between consecutive terms. For example in the sequence 2, 6, 18, 54..., the common ratio is 3.

index

The index of a term in a sequence is the term’s “place” in the sequence.

recursive

The recursive formula for a sequence allows you to find the value of the nth term in the sequence if you know the value of the (n-1)th term in the sequence.

recursive formula

The recursive formula for a sequence allows you to find the value of the nth term in the sequence if you know the value of the (n-1)th term in the sequence.

sequence

A sequence is an ordered list of numbers or objects.