# find_linear_recurrence function

The recurrence a list of terms obeys, given only when it also holds on two more.

## How to write it

### find_linear_recurrence(terms)

An equation a(n + r) = ... in the terms before it, not the list of its coefficients.

**terms**

The first terms, whole numbers or fractions, the first being a(1). Takes a list.

## Examples

- $\displaystyle 1, 1, 2, 3, 5, 8, \ldots \Rightarrow a(n+2) = a(n)+a(n+1)$

  `find_linear_recurrence([1, 1, 2, 3, 5, 8])`

  In the solver, `find_linear_recurrence([1, 1, 2, 3, 5, 8])` gives `a(n + 2) = a(n) + a(n + 1)`.

  [Open in the solver](https://hilberon.com/?q=find_linear_recurrence%28%5B1%2C%201%2C%202%2C%203%2C%205%2C%208%5D%29)
- $\displaystyle 1, 3, 9, 27, 81, 243, \ldots \Rightarrow a(n+1) = 3 a(n)$

  `find_linear_recurrence([1, 3, 9, 27, 81, 243])`

  In the solver, `find_linear_recurrence([1, 3, 9, 27, 81, 243])` gives `a(n + 1) = 3a(n)`.

  [Open in the solver](https://hilberon.com/?q=find_linear_recurrence%28%5B1%2C%203%2C%209%2C%2027%2C%2081%2C%20243%5D%29)

## Related functions

- [find_sequence_function](https://hilberon.com/library/find_sequence_function)

  The formula of a sequence from its first terms, given only when it also predicts two more.
- [differences](https://hilberon.com/library/differences)

  The differences between neighbouring elements of a list.
- [next_terms](https://hilberon.com/library/next_terms)

  The terms that follow a list, given only when a rule explains it and predicts two more.
- [sum_convergence](https://hilberon.com/library/sum_convergence)

  Test whether the sum of an expression over a variable converges.
- [numeric_product](https://hilberon.com/library/numeric_product)

  Multiply an expression over a range, as a decimal.
- [sum](https://hilberon.com/library/sum)

  Sum of an expression over one or more ranges.

---
Source: https://hilberon.com/library/find_linear_recurrence
