Linear recurrence calculator
Generate exact terms of an integer recurrence from seed values and coefficients. Your inputs stay on your device.
Set up your task
Starting local processing
Ready. Processing stays in this browser.
2 Your result
Your result updates in this browser. Check your input if the result looks unexpected.
How to use Linear recurrence calculator
Generate exact terms of an integer recurrence from seed values and coefficients. The pre-filled problem gives you a worked starting point. Compare the response with your own working before trying the self-check below.
- Check the example inputs: Initial values (from a(0)), Coefficients (most recent term first), Terms including seeds.
- Change the inputs for your problem. Results update as you type, so finish entering the values before copying an answer.
- Use the working to check an intermediate value or assumption. Then change the example as suggested in the self-check and compare the result.
Supported inputs and limits
Enter one to six seed values and the same number of coefficients, with the coefficient on the most recent term first. Generate up to 40 terms.
How it works
A linear recurrence builds every later term from a weighted sum of a fixed number of earlier terms. Seeds supply the first values before that rule can run. The most recent term gets the first coefficient, the second-most-recent gets the next coefficient, and so on.
Iteration is one way to verify an example before deriving a closed form. A list of computed terms can reveal an off-by-one index, an incorrectly ordered coefficient or a mistaken initial value. This tool uses signed exact integers even for values that would exceed ordinary floating-point integer precision.
Example
Run the pre-filled example. Its first result is βTerm a(9): 34β.
- Initial values (from a(0))
- 0 1
- Coefficients (most recent term first)
- 1 1
- Terms including seeds
- 10
Term a(9): 34 a(0) = 0 a(1) = 1 a(2) = 1 a(3) = 2 a(4) = 3 a(5) = 5 a(6) = 8
Questions about Linear recurrence calculator
Is count the number of new terms to generate?
Count includes the seed values. With two seeds and count five, the calculator adds three terms and ends at a(4).
Why do coefficients and seeds have the same length?
Each coefficient needs a previous value at the first recurrence step. The seeds provide exactly that history.
Use one seed 3, one coefficient β2, and four terms.
Expect a(0) = 3, a(1) = β6, a(2) = 12 and a(3) = β24. Negative coefficients can produce alternating signs.
Related tools
Last updated