Evanalysis
5.1Embedded interactionEstimated reading time: 19 min

5.1 Sequences, recursion, and series

Read sequences as functions on positive integers, compare explicit and recursive definitions, and derive arithmetic and geometric sum formulas.

Course contents

MATH1025: Preparatory mathematics

Preparatory mathematics notes.

Chapter 4Binomial theorem1 sections

What a sequence really is

A sequence is not merely a row of numbers written with commas. Formally, it is a function whose input is a positive integer and whose output is a real number. The input tells us the position of the term. The output is the value sitting at that position.

Definition

Sequence of real numbers

A sequence of real numbers is a function

a:Z+R.a:\mathbb Z^+\to \mathbb R.

Instead of writing a(n), we usually write ana_n, and we denote the whole sequence by an{a_n}.

This definition is worth taking seriously. It explains why the same values in a different order form a different sequence, and why a formula for ana_n must say what happens for every positive integer n.

Worked example

Reading a general term

If an=(1)na_n=(-1)^n, then

a1=1,a2=1,a3=1,a4=1.a_1=-1,\quad a_2=1,\quad a_3=-1,\quad a_4=1.

If bn=2n1b_n=2^{n-1}, then

b1=1,b2=2,b3=4,b4=8.b_1=1,\quad b_2=2,\quad b_3=4,\quad b_4=8.

Both are sequences because each positive integer n determines exactly one real number.

Finding general terms from patterns

A finite list suggests a pattern, but the general term must describe the n-th term, not just the first few terms.

Worked example

Alternating zeros and ones

The sequence

1,0,1,0,1,0,1,0,\ldots

is 1 when n is odd and 0 when n is even. A compact formula is

an=1+(1)n12.a_n=\frac{1+(-1)^{n-1}}2.

When n is odd, n1n-1 is even and the numerator is 2. When n is even, n1n-1 is odd and the numerator is 0.

Worked example

Products of even and odd factors

The product

246(2n)2\cdot4\cdot6\cdots(2n)

has the k-th factor 2k. Therefore

24(2n)=k=1n2k=2nn!.2\cdot4\cdots(2n) =\prod_{k=1}^n 2k =2^n n!.

Similarly,

135(2n1)=(2n)!2nn!,1\cdot3\cdot5\cdots(2n-1) =\frac{(2n)!}{2^n n!},

because (2n)! is the product of all factors from 1 to 2n, and dividing by the even part 24(2n)=2nn!2\cdot4\cdots(2n)=2^n n! leaves only the odd part.

Worked example

A sequence made from repeated differentiation

The chapter also uses f(x)=sinxf(x)=\sin x to show that sequences do not have to come from ordinary lists first. Define an=f(n)(0)a_n=f^{(n)}(0), where f(n)f^{(n)} means the n-th derivative. The derivatives cycle:

sinx,cosx,sinx,cosx,sinx,\sin x,\quad \cos x,\quad -\sin x,\quad -\cos x,\quad \sin x,\ldots

So

a1=1,a2=0,a3=1,a4=0,a_1=1,\quad a_2=0,\quad a_3=-1,\quad a_4=0,

and the same four-term pattern repeats. One compact general term is

an=cos((n1)π2).a_n=\cos\left(\frac{(n-1)\pi}{2}\right).

This example is important because it separates the idea of a sequence from the idea of a simple algebraic pattern. The sequence is still a function of the index n; its values are produced by a calculus operation before evaluating at 0.

Common mistake

A pattern is not a definition until the indexing is fixed

Writing 2,4,8,... is not as precise as writing an=2n1a_n=2^{n-1}. The first term matters: 2n2^n would give 2,4,8,... only if the indexing started at n=1n=1 with first term 2, while the chapter example 1,2,4,8,... is 2n12^{n-1}.

Recursive definitions

Some sequences are easier to define by saying how to get the next term from earlier terms.

Definition

Recursive sequence

A recursive sequence is a sequence whose terms are defined using one or more preceding terms, together with enough initial values to start the process.

For example,

a1=4,an+1=2an+1a_1=4,\qquad a_{n+1}=2a_n+1

gives

a2=9,a3=19,a4=39.a_2=9,\quad a_3=19,\quad a_4=39.

The recurrence determines the next term only after the earlier term is known.

For this particular recurrence, we can also find a closed formula. Add 1 to both sides and set bn=an+1b_n=a_n+1. Then

bn+1=an+1+1=2an+2=2(an+1)=2bn.b_{n+1}=a_{n+1}+1=2a_n+2=2(a_n+1)=2b_n.

Since b1=a1+1=5b_1=a_1+1=5, the transformed sequence is geometric:

bn=52n1.b_n=5\cdot2^{n-1}.

Therefore

an=bn1=52n11.a_n=b_n-1=5\cdot2^{n-1}-1.

The lesson is not that every recurrence becomes geometric. The useful habit is to look for a change of variables that removes the constant term when the recurrence is affine.

Theorem

Recursion theorem

Let XX be a set, let bXb\in X, and let f:XXf:X\to X be a function. Then there is a unique function a:Z+Xa:\mathbb Z^+\to X such that

a(1)=b,a(n+1)=f(a(n))a(1)=b,\qquad a(n+1)=f(a(n))

for every nZ+n\in\mathbb Z^+.

The theorem gives the formal reason why a first term plus a rule such as an+1=f(an)a_{n+1}=f(a_n) really defines a sequence. The rule never leaves XX, because f maps XX back into XX, and uniqueness says that there is no second sequence satisfying the same starting value and same next-term rule.

Worked example

Turning a recurrence into theorem data

For

a1=1,an+1=an2+1,a_1=1,\qquad a_{n+1}=a_n^2+1,

take X=RX=\mathbb R, b=1b=1, and f(x)=x2+1f(x)=x^2+1. The recursion theorem says that there is a unique real sequence satisfying this rule. The first terms are

1,2,5,26,1,\quad 2,\quad 5,\quad 26,\ldots

There may be no simple closed formula, but the sequence is still completely defined.

Fibonacci as a first-order recursion on pairs

The Fibonacci sequence is defined by two starting values and a rule using the previous two terms:

F1=F2=1,Fn+2=Fn+1+Fn.F_1=F_2=1,\qquad F_{n+2}=F_{n+1}+F_n.

To fit the recursion theorem, package two consecutive values as one ordered pair:

a(n)=(Fn,Fn+1).a(n)=(F_n,F_{n+1}).

Then the next pair is obtained from the function

f(x,y)=(y,x+y).f(x,y)=(y,x+y).

So a two-term recurrence can be viewed as a one-step recurrence on the set R2\mathbb R^2.

Theorem

Binet form of Fibonacci numbers

Let

ϕ=1+52,ψ=152.\phi=\frac{1+\sqrt5}{2}, \qquad \psi=\frac{1-\sqrt5}{2}.

Then for every positive integer n,

Fn=ϕnψnϕψ.F_n=\frac{\phi^n-\psi^n}{\phi-\psi}.

This formula is usually proved by checking that the right-hand side has the same first two values and satisfies the same recurrence. The essential identities are ϕ2=ϕ+1\phi^2=\phi+1 and ψ2=ψ+1\psi^2=\psi+1.

Here is the verification in a form that is useful for similar recurrence questions. Define

Bn=ϕnψnϕψ.B_n=\frac{\phi^n-\psi^n}{\phi-\psi}.

First,

B1=1,B2=ϕ2ψ2ϕψ=ϕ+ψ=1.B_1=1,\qquad B_2=\frac{\phi^2-\psi^2}{\phi-\psi}=\phi+\psi=1.

Next, because each of ϕ\phi and ψ\psi satisfies t2=t+1t^2=t+1, we have

ϕn+2=ϕn+1+ϕn,ψn+2=ψn+1+ψn.\phi^{n+2}=\phi^{n+1}+\phi^n, \qquad \psi^{n+2}=\psi^{n+1}+\psi^n.

Subtracting the second identity from the first and dividing by ϕψ\phi-\psi gives

Bn+2=Bn+1+Bn.B_{n+2}=B_{n+1}+B_n.

Thus Bn{B_n} has the same first two values and the same recursive rule as the Fibonacci sequence. By uniqueness of the recursively defined sequence, BnB_n must equal FnF_n for every positive integer n.

Arithmetic sequences and sums

Definition

Arithmetic sequence

A sequence an{a_n} is arithmetic if there is a constant d such that

an+1an=da_{n+1}-a_n=d

for every nZ+n\in\mathbb Z^+. The number d is the common difference.

If a=a1a=a_1, then the general term is

an=a+(n1)d.a_n=a+(n-1)d.

The sum of the first n terms is

sn=k=1nak=n2[2a+(n1)d]=n2(a1+an).s_n=\sum_{k=1}^n a_k =\frac n2\left[2a+(n-1)d\right] =\frac n2(a_1+a_n).

The last equality comes from pairing the first term with the last, the second with the second-last, and so on. Every pair has the same sum a1+ana_1+a_n.

Worked example

Recover an arithmetic sequence from a sum

Suppose the common difference is d=3/2 and the sum of the first 15 terms is 240. Then

240=152[2a+1432].240=\frac{15}{2}\left[2a+14\cdot\frac32\right].

Solving gives a=5.5a=5.5.

If the sum of the first k terms is 361, then

k2[2(5.5)+(k1)32]=361.\frac{k}{2}\left[2(5.5)+(k-1)\frac32\right]=361.

This simplifies to

3k2+19k1444=0.3k^2+19k-1444=0.

The positive integer solution is k=19k=19; the other root is rejected because a number of terms cannot be negative.

Geometric sequences and sums

Definition

Geometric sequence

A sequence bn{b_n} of nonzero numbers is geometric if there is a nonzero constant r such that

bn+1bn=r\frac{b_{n+1}}{b_n}=r

for every nZ+n\in\mathbb Z^+. The number r is the common ratio.

If b=b1b=b_1, then

bn=brn1.b_n=br^{n-1}.

For r1r\ne 1, the finite geometric sum is

k=1nbrk1=bk=0n1rk=b1rn1r=brn1r1.\sum_{k=1}^n br^{k-1} =b\sum_{k=0}^{n-1}r^k =b\frac{1-r^n}{1-r} =b\frac{r^n-1}{r-1}.

The proof is the subtraction trick:

(1r)(1+r++rn1)=1rn.(1-r)(1+r+\cdots+r^{n-1})=1-r^n.

If r=1r=1, the sum is simply bn.

Read and try

Compare recursive and explicit sequence descriptions

The lab lets readers switch among arithmetic, geometric, and affine recursive sequences to compare terms, closed forms, and finite sums.

Key relation

a1=5.5a_1=5.5, an+1=an+1.5a_{n+1}=a_n+1.5

Result

an=5.5+1.5(n1)a_n=5.5+1.5(n-1)

Successive differences stay constant. The sum pairs the first and last terms.

Show between 1 and 12 displayed terms or months.

na_nPartial sum sns_n
15.55.5
27.012.5
38.521.0
410.031.0
511.542.5
613.055.5

Arithmetic-geometric sums

The final exercise in the source chapter mixes an arithmetic factor with a geometric factor. Let

xk=(a+kd)brk,kN,x_k=(a+kd)br^k,\qquad k\in\mathbb N,

where r0r\ne0 and r1r\ne1, and define

Sn=k=0n1xk=k=0n1(a+kd)brk.S_n=\sum_{k=0}^{n-1}x_k =\sum_{k=0}^{n-1}(a+kd)br^k.

This is not a new kind of magic formula. It is the same subtraction method, but now the coefficient changes by d when the index moves forward. Compare SnS_n with rSnrS_n:

SnrSn=ab+db(r+r2++rn1)(a+(n1)d)brn.S_n-rS_n =ab+db(r+r^2+\cdots+r^{n-1})-(a+(n-1)d)br^n.

The middle part is again a geometric sum. Dividing by 1r1-r and simplifying gives the source formula

Sn=ab(a+nd)brn1r+dbr(1rn)(1r)2.S_n= \frac{ab-(a+nd)br^n}{1-r} +\frac{dbr(1-r^n)}{(1-r)^2}.

Common mistake

Watch the shifted boundary term

The boundary term is the subtle point. The last term in rSnrS_n is (a+(n1)d)brn(a+(n-1)d)br^n, but after combining with the finite geometric sum the equivalent final formula can be written with (a+nd)brn(a+nd)br^n.

An applied recurrence: the mortgage formula

The chapter's mortgage example is a useful applied recurrence. Let:

  • PP be the initial principal;
  • RR be the annual fixed interest rate;
  • NN be the duration in months;
  • x be the monthly payment;
  • LnL_n be the loan amount after the n-th monthly payment.

Then

L0=P,Ln=Ln1(1+R12)x.L_0=P,\qquad L_n=L_{n-1}\left(1+\frac{R}{12}\right)-x.

Writing q=1+R/12, repeated substitution gives

Ln=Pqnx(qn1+qn2++q+1).L_n=Pq^n-x(q^{n-1}+q^{n-2}+\cdots+q+1).

Using the geometric sum,

Ln=Pqnxqn1q1.L_n=Pq^n-x\frac{q^n-1}{q-1}.

To finish the loan after NN months, set LN=0L_N=0, so

x=P(R/12)(1+R/12)N(1+R/12)N1.x=P\frac{(R/12)(1+R/12)^N}{(1+R/12)^N-1}.

The formula is not a separate trick. It is the geometric series formula applied to a recurrence where interest multiplies the balance and the payment subtracts from it.

Quick checks

Quick check

A sequence is formally a function from which set to which set in this chapter?

Use the chapter definition.

Solution

Answer

Quick check

For a1=4a_1=4 and an+1=2an+1a_{n+1}=2a_n+1, what is a3a_3?

Compute one term at a time.

Solution

Answer

Quick check

What is the sum of the first n terms of an arithmetic sequence with first term a and common difference d?

Use first-last pairing.

Solution

Answer

Quick check

Why does the geometric-sum formula need a separate case when r=1r=1?

Look at the denominator.

Solution

Answer

Quick check

In the arithmetic-geometric sum, why is the method SnrSnS_n-rS_n useful?

Track what happens to the coefficient a+kda+kd after shifting by one power of r.

Solution

Answer

Exercises

  1. Find a formula for 1,0,1,0,1,0,1,0,\ldots.
  2. Prove that 1\cdot3\cdot5\cdots(2n-1)=(2n)!/(2^n n!).
  3. Let a1=3a_1=3 and an+1=an+4a_{n+1}=a_n+4. Find ana_n and sns_n.
  4. Let b1=5b_1=5 and bn+1=3bnb_{n+1}=3b_n. Find bnb_n and the sum of the first n terms.
  5. Let B_n=(\phi^n-\psi^n)/(\phi-\psi), where \phi=(1+\sqrt5)/2 and \psi=(1-\sqrt5)/2. Verify that B1=B2=1B_1=B_2=1 and Bn+2=Bn+1+BnB_{n+2}=B_{n+1}+B_n.
  6. Let L0=2000L_0=2000 and Ln=1.02Ln1150L_n=1.02L_{n-1}-150. Write LnL_n using a finite geometric sum.
  7. Let x_k=(2+3k)5(1/2)^k and Sn=k=0n1xkS_n=\sum_{k=0}^{n-1}x_k. Write SnS_n using the arithmetic-geometric formula.

Guided solutions

  1. The term is 1 on odd indices and 0 on even indices, so a_n=(1+(-1)^{n-1})/2.

  2. Divide (2n)! into its even and odd factors. The even product is 24(2n)=2nn!2\cdot4\cdots(2n)=2^n n!, so the odd product is (2n)!/(2^n n!).

  3. This is arithmetic with first term 3 and common difference 4, hence an=3+4(n1)=4n1a_n=3+4(n-1)=4n-1 and s_n=n[2\cdot3+(n-1)4]/2=n(2n+1).

  4. This is geometric with first term 5 and ratio 3, so bn=53n1b_n=5\cdot3^{n-1} and s_n=5(3^n-1)/(3-1)=5(3^n-1)/2.

  5. Since ϕ2=ϕ+1\phi^2=\phi+1 and ψ2=ψ+1\psi^2=\psi+1, multiplying by ϕn\phi^n or ψn\psi^n gives ϕn+2=ϕn+1+ϕn\phi^{n+2}=\phi^{n+1}+\phi^n and ψn+2=ψn+1+ψn\psi^{n+2}=\psi^{n+1}+\psi^n. Subtract the two identities and divide by ϕψ\phi-\psi to obtain Bn+2=Bn+1+BnB_{n+2}=B_{n+1}+B_n. Also B1=1B_1=1 and B_2=(\phi^2-\psi^2)/(\phi-\psi)=\phi+\psi=1. Therefore Bn{B_n} satisfies the same initial values and recurrence as Fibonacci.

  6. Repeated substitution gives L_n=2000(1.02)^n-150[(1.02)^{n-1}+\cdots+1], so L_n=2000(1.02)^n-150((1.02)^n-1)/0.02.

  7. Here a=2a=2, d=3d=3, b=5b=5, and r=1/2. Therefore

    Sn=10(2+3n)5(1/2)n11/2+15(1/2)(1(1/2)n)(11/2)2.S_n= \frac{10-(2+3n)5(1/2)^n}{1-1/2} +\frac{15(1/2)(1-(1/2)^n)}{(1-1/2)^2}.

    This can be simplified further, but the important point is the substitution into the general finite-sum formula.

Section mastery checkpoint

Answer each question correctly to complete this section checkpoint. Correct progress: 0%.

Skills: sequences, general-term, factorials

Exercise 5.1 asks for a general term of 2,24,246,...2, 2\cdot4, 2\cdot4\cdot6, .... Fill in the blank: for nZ+n\in \mathbb Z^+, a_n = 2\cdot4\cdots(2n) = ____.

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

Syntax guidance: Enter the general term using n, powers, and factorial notation.

  • Enter an expression such as 2nn!2^n*n!.

Skills: sequences, recursion, recursive-definition

Example 5.2 defines a1=4a_1=4 and an+1=2an+1a_{n+1}=2a_n+1 for n1n\ge 1. Fill in the blank: a_4 = ____.

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

Syntax guidance: Enter the value of the fourth term.

  • Enter a single number.

Skills: sequences, recursion-theorem, existence-uniqueness

According to the recursion theorem in chapter 5, let XX be a set, bXb\in X, and f:XXf:X\to X. Does a(1)=ba(1)=b and a(n+1)=f(a(n))a(n+1)=f(a(n)) determine a unique function a:Z+Xa:\mathbb Z^+\to X?

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

  • For a1=1a_1=1 and an+1=an2+1a_{n+1}=a_n^2+1, the self-map is f(x)=x2+1f(x)=x^2+1.

Skills: sequences, fibonacci, recursion, closed-form-verification

Let B_n=(\phi^n-\psi^n)/(\phi-\psi), where ϕ2=ϕ+1\phi^2=\phi+1 and ψ2=ψ+1\psi^2=\psi+1. Which check proves that BnB_n satisfies the Fibonacci recurrence?

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

  • ϕ2=ϕ+1\phi^2=\phi+1 implies ϕn+2=ϕn+1+ϕn\phi^{n+2}=\phi^{n+1}+\phi^n, and similarly for ψ\psi.

Skills: sequences, arithmetic-geometric-series, finite-sums

For xk=(a+kd)brkx_k=(a+kd)br^k and Sn=k=0n1xkS_n=\sum_{k=0}^{n-1}x_k, which formula matches the arithmetic-geometric sum derived from SnrSnS_n-rS_n?

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

  • Look for the formula that has both a boundary term and the extra dbr correction.

Key terms in this unit