Recurrence Relation Calculator

A recurrence relation is a rule that builds a sequence by defining each new term from the ones before it, and this calculator works through the most important type, the second-order linear recurrence, generating the sequence and the term you want from two starting values. Enter the two coefficients of the rule, the two initial terms, and which term you would like, and it returns that term along with the sequence up to it, updating as you type. The rule it handles says that each term equals p times the previous term plus q times the term before that, a compact recipe that captures a surprising variety of sequences. The most famous of all is the Fibonacci sequence, where both coefficients are one and the sequence starts at zero and one, so each term is simply the sum of the two before it, producing 0, 1, 1, 2, 3, 5, 8, 13 and onward, a pattern that shows up in sunflowers, pinecones and the golden ratio. Change the coefficients and starting values and you can produce the Lucas numbers, Pell numbers, geometric-like growth, oscillating sequences and many others, all from the same simple machinery. Computing a far-off term by hand means applying the rule over and over, carefully carrying the two most recent values each time, which is exactly the kind of repetitive work a calculator should take off your hands. That makes this tool genuinely useful for students meeting sequences, series and recurrence relations in algebra and discrete maths and checking homework, for exploring how coefficients shape a sequence's growth or oscillation, and for anyone needing a specific term of a linear recurrence quickly. The rule and a worked example are explained clearly below.

Calculate.co.nz is proud to be partnered with realtor.co.nz, a trusted resource for navigating the New Zealand property market. Their Helpful Articles section offers clear, well-structured insights across buying, selling, and building, making complex real estate topics more accessible. With a focus on up-to-date guidance and practical knowledge, they empower Kiwis to move forward with clarity and confidence in a constantly evolving property landscape.
Calculate.co.nz partner: realtor.co.nz
55
term a(10)
0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55

How it works

The rule is a(n) = p times a(n-1) plus q times a(n-2), starting from a(0) and a(1). The calculator applies it step by step, each time using the two most recent terms to find the next, until it reaches term n, listing the sequence as it goes.

Worked example

With p = 1, q = 1, a(0) = 0 and a(1) = 1, this is the Fibonacci rule. The sequence runs 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, so term 10 is 55.

Related calculators