Skip to content

A recursion rule

A recursion rule

A recursion rule

A recursion rule defines a sequence in two parts:

  • a starting condition – the first term, for example a1=3\displaystyle {a_1}={3};
  • the rule – how each term is worked out from the term before it, for example an+1=2an−1\displaystyle {a_{n+1}}={2a_n-1}.

From the rule the terms come one after another:

  • a2=2⋅3−1=5\displaystyle {a_2}={2\cdot3-1}={5};
  • a3=2⋅5−1=9\displaystyle {a_3}={2\cdot5-1}={9};
  • a4=2⋅9−1=17\displaystyle {a_4}={2\cdot9-1}={17}.

A computer works out a sequence defined by a recursion rule the same way: step by step, each step from the result of the step before.

From a formula by place to a recursion rule

With a formula by place, write an+1\displaystyle a_{n+1} and look for an\displaystyle a_n in it. In the sequence an=n2\displaystyle {a_n}={n^2}:

an+1=(n+1)2=n2+2n+1=an+2n+1a_{n+1}=(n+1)^2=n^2+2n+1=a_n+2n+1
  • The rule: a1=1\displaystyle {a_1}={1}, an+1=an+2n+1\displaystyle {a_{n+1}}={a_n+2n+1}.
  • The rule has a meaning: each square is greater than the square before it by the odd number 2n+1\displaystyle 2n+1.
Guessing a formula from the terms

The other way, from a recursion rule to a formula by place, is usually hard, and sometimes there is no simple formula at all. Sometimes it can be guessed from the terms.

In the sequence a1=3\displaystyle {a_1}={3}, an+1=2an−1\displaystyle {a_{n+1}}={2a_n-1} the terms are 3,5,9,17,33,…\displaystyle 3, 5, 9, 17, 33, \ldots

  • Each term is 1 more than a power of 2: 3=2+1\displaystyle {3}={2+1}, 5=4+1\displaystyle {5}={4+1}, 9=8+1\displaystyle {9}={8+1}.
  • The guess: an=2n+1\displaystyle {a_n}={2^n+1}.
  • A guess that fits the first five terms is not a proof that it fits them all. The proof comes with mathematical induction, later in the course.
A periodic sequence

In the sequence a1=2\displaystyle {a_1}={2}, an+1=11−an\displaystyle {a_{n+1}}={\frac{1}{1-a_n}}:

  • a2=11−2=−1\displaystyle {a_2}={\frac{1}{1-2}}={-1};
  • a3=11−(−1)=12\displaystyle {a_3}={\frac{1}{1-(-1)}}={\frac{1}{2}};
  • a4=11−12=2=a1\displaystyle {a_4}={\frac{1}{1-\frac{1}{2}}}={2}={a_1}.

a4\displaystyle a_4 is a1\displaystyle a_1 again, so from here the rule gives the same terms again: 2,−1,12,2,−1,12,…\displaystyle 2, -1, \frac{1}{2}, 2, -1, \frac{1}{2}, \ldots This is a periodic sequence, and its period is 3.

  • a100\displaystyle a_{100}: 100=3⋅33+1\displaystyle {100}={3\cdot33+1}, that is, after 33 whole periods we reach the first place of a period: a100=a1=2\displaystyle {a_{100}}={a_1}={2}.
  • The sum of the first 99 terms: 33 periods, each with the sum 2−1+12=1.5\displaystyle {2-1+\frac{1}{2}}={1.5}, so 33⋅1.5=49.5\displaystyle {33\cdot1.5}={49.5}.
A rule using two terms

A recursion rule can use the two terms before a term. Then it needs two starting conditions.

  • The Fibonacci sequence: a1=1\displaystyle {a_1}={1}, a2=1\displaystyle {a_2}={1}, an+2=an+1+an\displaystyle {a_{n+2}}={a_{n+1}+a_n}.
  • Each term is the sum of the two terms before it: 1,1,2,3,5,8,13,21,…\displaystyle 1, 1, 2, 3, 5, 8, 13, 21, \ldots
Exercise 1

A sequence is defined by the recursion rule a1=5\displaystyle {a_1}={5}, an+1=an+2n\displaystyle {a_{n+1}}={a_n+2n}.
Calculate a4\displaystyle a_4.

    / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

    / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

    Exercise 2

    The sequence: an=3n−1\displaystyle {a_n}={3n-1}.

    a

    Simplify an+1−an\displaystyle a_{n+1}-a_n.

      / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

      / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

      b

      Write a recursion rule for the sequence.

      Exercise 3

      The sequence: an=n2+n\displaystyle {a_n}={n^2+n}.
      Write an+1\displaystyle a_{n+1} as an\displaystyle a_n plus an expression in n\displaystyle n, and write a recursion rule for the sequence.

        / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

        / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

        Exercise 4

        A sequence is defined by the recursion rule a1=3\displaystyle {a_1}={3}, an+1=an+1an−1\displaystyle {a_{n+1}}={\frac{a_n+1}{a_n-1}}.

        a

        Calculate a2\displaystyle a_2, a3\displaystyle a_3 and a4\displaystyle a_4. What can be said about the sequence?

        b

        What is a51\displaystyle a_{51}?

          / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

          / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

          c

          Calculate the sum of the first 20 terms.

            / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

            / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

            Exercise 5

            In the picture of the squares from the lesson before, stage n\displaystyle n has an=4n\displaystyle {a_n}={4n} shaded squares.
            Write a recursion rule for an\displaystyle a_n, and explain it with the picture.