Grade by Grade
C. Discrete Functions · Sequences and Series

Recursive Procedures: Building a Sequence Step by Step

C1.2 C1.3 C1.4About 70 minutes
Learning goals
  • I can describe, in words and with a flow chart, a recursive procedure that generates a sequence.
  • I can write a recursion formula using t₁ and tₙ₋₁.
  • I can write terms of a sequence from a recursion formula.
  • I can represent a sequence with a table of values and a graph.

Words to know

recursive procedure
A process that makes each new term by doing something to the term (or terms) before it.
recursion formula
A rule that gives the first term(s) and a formula for tₙ using earlier terms, e.g. t₁ = 1, tₙ = tₙ₋₁ + n.
tₙ₋₁
The term just before tₙ (the previous term). tₙ₋₂ is two terms before.
triangular numbers
1, 3, 6, 10, 15, 21, …: the numbers of dots that make triangles of 1, 2, 3, … rows.
flow chart
A diagram of boxes and arrows that shows the steps of a procedure in order, including steps that repeat.

Racking up the pins

In ten-pin bowling, the pins stand in a triangle: 1 pin in the front row, then 2, then 3, then 4. That makes 1 + 2 + 3 + 4 = 10 pins. If the triangle had 5 rows, it would need 15 pins; with 6 rows, 21 pins.

The numbers 1, 3, 6, 10, 15, 21, … are called the triangular numbers. Can you see how to get each one from the one before it? You add 2, then 3, then 4, then 5, then 6. Building a sequence this way, one step at a time from the previous term, is called a recursive procedure.

t₁ = 1t₂ = 3t₃ = 6t₄ = 10+2+3+4Row n addsn more dots:tₙ = tₙ₋₁ + n
The first four triangular numbers as dot triangles. To make the next triangle, add a new bottom row with n dots.

Describing a recursive procedure

A recursive procedure always has two parts:

  1. Where to start: the first term (or first few terms).
  2. How to get the next term from the term(s) before it.

You can describe it in words: "Start with 1. To get each new term, add its position number to the previous term."

You can also draw a flow chart. The loop in the chart repeats the same step over and over, which is exactly what a recursive procedure does.

Startt = 1, n = 1Write down tn = n + 1t = t + nStop afterenough termsOutput: 1, 3, 6, 10, 15, 21, …Each pass roundthe loop makesthe next term.
A flow chart that generates the triangular numbers. Follow the arrows: each pass around the loop increases n by 1, adds n to t, and writes down the new term.

Recursion formulas

Mathematicians write a recursive procedure as a recursion formula. We use tₙ₋₁ for the term just before tₙ.

For the triangular numbers:

t₁ = 1, tₙ = tₙ₋₁ + n, for n > 1

Read it as: "The first term is 1. Each term after that is the previous term plus n." Let's check: t₂ = t₁ + 2 = 3, t₃ = t₂ + 3 = 6, t₄ = t₃ + 4 = 10. ✓

A recursion formula needs both parts. Without t₁ = 1, the rule tₙ = tₙ₋₁ + n could start anywhere and give a different sequence.

Worked example

Example 1: From terms to a recursion formula

Write a recursion formula for each sequence, and describe it in words.

(a) 5, 8, 11, 14, … (b) 3, 6, 12, 24, … (c) 2, 3, 5, 9, 17, …

  1. (a) Each term is 3 more than the one before: 8 − 5 = 11 − 8 = 3. t₁ = 5, tₙ = tₙ₋₁ + 3. In words: start at 5 and keep adding 3.
  2. (b) Each term is double the one before: 6 ÷ 3 = 12 ÷ 6 = 2. t₁ = 3, tₙ = 2tₙ₋₁. In words: start at 3 and keep doubling.
  3. (c) The differences are 1, 2, 4, 8, so it is not "add the same number". Try doubling: 2 × 2 = 4, one more than 3; 3 × 2 = 6, one more than 5. Try "double and subtract 1": 2(2) − 1 = 3, 2(3) − 1 = 5, 2(5) − 1 = 9, 2(9) − 1 = 17 ✓. t₁ = 2, tₙ = 2tₙ₋₁ − 1.

(a) t₁ = 5, tₙ = tₙ₋₁ + 3 (b) t₁ = 3, tₙ = 2tₙ₋₁ (c) t₁ = 2, tₙ = 2tₙ₋₁ − 1

Worked example

Example 2: From a recursion formula to terms

Write the first five terms of t₁ = 4, tₙ = 3tₙ₋₁ − 5.

  1. t₁ = 4 (given).
  2. t₂ = 3t₁ − 5 = 3(4) − 5 = 7
  3. t₃ = 3t₂ − 5 = 3(7) − 5 = 16
  4. t₄ = 3(16) − 5 = 43
  5. t₅ = 3(43) − 5 = 124

4, 7, 16, 43, 124

Worked example

Example 3: A recursion formula that uses n

Write the first five terms of t₁ = 2, tₙ = tₙ₋₁ + 2n, and describe the pattern you see.

  1. t₂ = t₁ + 2(2) = 2 + 4 = 6
  2. t₃ = t₂ + 2(3) = 6 + 6 = 12
  3. t₄ = 12 + 8 = 20, t₅ = 20 + 10 = 30
  4. Pattern: 2 = 1 × 2, 6 = 2 × 3, 12 = 3 × 4, 20 = 4 × 5, 30 = 5 × 6. Each term is its position times the next number: tₙ = n(n + 1). (Each term is also double a triangular number.)

2, 6, 12, 20, 30

Tables and graphs

A sequence is a discrete function, so we can show it as a table of values and as a graph of points. The table below adds a column of first differences (each term minus the previous term). For the triangular numbers, the first differences are 2, 3, 4, 5, 6, which is the recursive rule "add n" showing up in the table. The second differences are all 1. Remember from Grade 10: constant second differences mean the pattern is quadratic, so the graph curves upward like half a parabola.

ntₙfirst differencesecond difference
11
232
3631
41041
51551
62161
The triangular numbers. The first differences match the recursive step "add n".
0123456751015202530ntₙ(1, 1)(2, 3)(3, 6)(4, 10)(5, 15)(6, 21)The points curve upward:the first differencesgrow by 1 each time.
The triangular numbers graphed as a discrete function. The points are not joined, and they follow an upward-curving (quadratic) path.

Recursion with technology

Spreadsheets are made for recursion. Put 1 in cell A1 (n) and 1 in cell B1 (t₁). In A2 type =A1+1, and in B2 type =B1+A2 (previous term plus n). Fill both cells down. Each row uses the row above, exactly like tₙ = tₙ₋₁ + n. The same idea works in a graphing calculator's sequence mode or a short program loop.

Just for fun

To understand recursion, you must first understand recursion.

(Don't worry: unlike that sentence, every recursion formula in this unit comes with a first term, so it knows where to stop looking back.)

Hands-on activity

Coin triangles and squares

You need: about 40 small identical objects (coins, buttons, dried beans or cereal pieces) and paper.

  1. Build triangles of 1, 2, 3, 4 and 5 rows. Count the objects in each. You should get the triangular numbers.
  2. Now build squares: 1 × 1, 2 × 2, 3 × 3, 4 × 4. How many objects do you add each time to go from one square to the next?
  3. Write a recursion formula for the square numbers 1, 4, 9, 16, 25, ….
  4. Put two triangles of the same size side by side, one flipped. What shape do they almost make?

What to look for: to go from an (n − 1) × (n − 1) square to an n × n square you add an L-shape of 2n − 1 objects (3, 5, 7, 9, …). So the square numbers follow t₁ = 1, tₙ = tₙ₋₁ + 2n − 1. Two equal triangles of n rows fit together to make an n by (n + 1) rectangle, which shows that the nth triangular number is n(n + 1)/2.

Your turn

1

Write a recursion formula for 7, 11, 15, 19, ….

2

Write a recursion formula for 80, 40, 20, 10, ….

3

Write the first five terms of t₁ = 6, tₙ = tₙ₋₁ − 4.

4

Write the first five terms of t₁ = 1, tₙ = 2tₙ₋₁ + 3.

5

Describe in words the recursive procedure for t₁ = 10, tₙ = tₙ₋₁ + 2n.

6

Find the 8th triangular number using the recursive rule and t₆ = 21.

7

Write a recursion formula for 1, 2, 6, 24, 120, ….

More practice: warm-up

1

In the recursion formula tₙ = tₙ₋₁ + 5, what does tₙ₋₁ mean?

2

Write the first four terms of t₁ = 2, tₙ = tₙ₋₁ + 9.

3

Write the first four terms of t₁ = 5, tₙ = 3tₙ₋₁.

4

What two parts does every recursion formula need?

5

Write a recursion formula for 100, 90, 80, 70, ….

More practice: on your own

1

Write a recursion formula for 3, 4, 6, 9, 13, 18, ….

2

Write the first five terms of t₁ = 64, tₙ = −tₙ₋₁ ÷ 2.

3

A sequence has t₁ = 3 and tₙ = tₙ₋₁² − 2. Find t₄.

4

Write a recursion formula for 2, 5, 11, 23, 47, ….

5

Draw (or describe) a flow chart that generates 5, 8, 11, 14, … and stops after 10 terms.

Challenge

1

The sequence 1, 3, 6, 10, 15, … satisfies tₙ = tₙ₋₁ + n. Use the idea of the activity (two triangles make a rectangle) to find t₅₀ without listing terms.

2

A recursion formula is t₁ = k, tₙ = 3tₙ₋₁ − 4. For which value of k is every term the same?

3

A sequence uses two previous terms: t₁ = 2, t₂ = 5, tₙ = tₙ₋₁ + tₙ₋₂. Write the first eight terms, then say which of them are even.

Check your understanding

Quiz

1.

What are the first four terms of t₁ = 3, tₙ = tₙ₋₁ + 6?

2.

Which recursion formula generates 4, 12, 36, 108, …?

3.

In a recursion formula, tₙ₋₁ stands for:

4.

For t₁ = 2, tₙ = 2tₙ₋₁ + 1, what is t₄?

5.

The triangular numbers follow t₁ = 1, tₙ = tₙ₋₁ + n. What is t₇?

6.

Why must a recursion formula include a starting term?

For parents and teachers

Big idea: Expectation C1.2 asks students to find and describe a recursive procedure (in words or with a flow chart) from the first few terms, using the curriculum's own example of the triangular numbers 1, 3, 6, 10, 15, 21, …, and to show sequences as tables and graphs. This lesson also starts C1.3 and C1.4 by writing terms from recursion formulas.

How to help: Recursion is "what do I do to the last one to get the next one?" Give your teen a short list (like 2, 6, 18, 54) and ask for the rule in plain words first, then in symbols. A spreadsheet that fills down a recursive formula makes the idea very concrete.

Common difficulties:

  • Forgetting the starting term t₁.
  • Reading tₙ₋₁ as "tₙ minus 1". It means the previous term.
  • Assuming every sequence adds a constant. Check differences and ratios, and also try "multiply then add" (Example 1c).
  • Arithmetic slips in long recursions. Each term depends on the last, so one mistake carries forward. Check each step.