One idea, one pictureFirst look at the row on the left. Each number is computed from the two before it. Then look at the right side. The two roots of the characteristic equation, the closed form solved from them — do its values match the recurrence one by one? Drag p, q and the initial values, and watch the formula follow.
Loading figure…
In one sentence
A function whose domain is the set of positive integers N+ is just a sequence: f(1),f(2),f(3),…. If the functional equation expresses f(n+1) (or f(n+2)) in terms of earlier values, it is a recurrence relation. Together with the initial values it determines f completely, and what is left is to find the general term.
Compute step by step from the initial values: f(3)=5+2=7, f(4)=7+10=17, f(5)=17+14=31… The function is already completely determined; the question is to write down a formula.
1,5,7,17,31,…
Try xⁿ
Two roots, two basic solutions
Fix the constants from the initial values
Check
Predict first
f(n+2)=5f(n+1)−6f(n), f(1)=5, f(2)=13. What is f(5)?
Choose an answer first; then you can see the result.
✓You predicted it!✗Not what you expected — which is exactly why it is worth a pause.
The characteristic equation x2=5x−6 has roots 2,3. From 2c1+3c2=5 and 4c1+9c2=13 we get c1=c2=1, so f(n)=2n+3n and f(5)=32+243=275.
The recurrence itself confirms it: 13×5−5×6=35, 35×5−13×6=97, 97×5−35×6=275.
Loading figure…
Stop 1 · First-order recurrences: add them up
Example.f:N+→N+, f(m+n)=f(m)+f(n)+mn, f(1)=1.
Put m=1: f(n+1)=f(n)+n+1. This is a first-order recurrence. The difference between neighboring terms is known, so add them up:
f(n)=f(1)+k=1∑n−1(k+1)=1+2+⋯+n=2n(n+1).
Substitute back into the original equation: 2(m+n)(m+n+1)=2m(m+1)+2n(n+1)+mn ✓. This is the same routine as plugging in values on the previous stop: plugging in m=1 creates the recurrence, and the recursion method then solves it.
This is the example at the start of the page. The key points:
If the characteristic equation x2=px+q has two distinct roots x1,x2, then f(n)=c1x1n+c2x2n;
If it has a double root x1, then f(n)=(c1+c2n)x1n;
Solve for the constants from f(1) and f(2), and check at the end.
Stop 3 · Double roots
Break it
Counterexample lab: remove one condition
Conclusion: f(n)=c1x1n+c2x2n can match any two initial values← still true?
f(n+2)=f(n+1)+6f(n): the roots are 3 and −2, and the two basic solutions 3n and (−2)n each get a constant. Drag the initial values: the formula always keeps up.
Loading figure…
f(n+2)=4f(n+1)−4f(n): the characteristic equation x2−4x+4=0 has only one root, 2. c1⋅2n+c2⋅2n really has only one constant, which is not enough. The workbench gives a different form:
Loading figure…
The second basic solution is n⋅2n. Check: in (n+2)2n+2=4⋅(n+1)2n+1−4⋅n2n both sides equal (n+2)⋅2n+2 ✓.
Practice
Exercise 1Basic
f(n+2)=3f(n+1)−2f(n), f(1)=1, f(2)=3. Find f(10).
Hint · direction
The characteristic equation is x2=3x−2.
Hint · method
The roots are 1 and 2; write f(n)=c1+c2⋅2n.
Hint · first step
c1+2c2=1 and c1+4c2=3 give c2=1, c1=−1.
Full solution
f(n)=2n−1, so f(10)=1023.
Exercise 2Basic
f(n+1)=f(n)+2n+1, f(1)=1. Find f(20).
Hint · direction
The difference between neighboring terms is 2n+1.
Hint · method
Add up: f(n)=1+∑k=1n−1(2k+1).
Hint · first step
1+3+5+⋯+(2n−1)=n2.
Full solution
f(n)=n2, so f(20)=400.
Exercise 3Advanced
f:N+→N+ satisfies f(m+n)=f(m)+f(n)+mn and f(1)=2. Find f(10).
Hint · direction
Plug in a value to create a recurrence, as in Stop 1; only the initial value has changed.
Still writing $c_1x_1^n+c_2x_2^n$ for a double root
✗
The wrong step: f(n+2)=4f(n+1)−4f(n) has characteristic roots x1=x2=2, so f(n)=c1⋅2n+c2⋅2n.
What went wrong? Think first, then open
Diagnosisc1⋅2n+c2⋅2n=(c1+c2)2n really has only one unknown constant, which cannot match two initial values f(1) and f(2). For example, with f(1)=2 and f(2)=12, 2c=2 contradicts 4c=12.
✓
The right step: For a double root the general term is f(n)=(c1+c2n)x1n. The example above gives f(n)=(2n−1)⋅2n; check it term by term: 2,12,40,112,…
“Two initial values need two independent constants”
Functional Equations: Recursion ← → step · F full screen · Esc exit