Recursion formula

A recursion formula is a mathematical formula that defines a sequence or set of values in terms of one or more previous values. It is also known as a recurrence relation. In general, the formula takes the form:

a_n = f(a_{n-1}, a_{n-2}, ..., a_{n-k})

where a_n is the nth term in the sequence, a_{n-1}, a_{n-2}, ..., a_{n-k} are the previous k terms, and f is a function that computes the nth term based on the previous terms.

Recursion formulas are commonly used in various areas of mathematics, such as in number theory, combinatorics, and computer science, where they are used to define recursive algorithms and data structures. They can also be used to model various natural phenomena, such as population growth, fractals, and cellular automata.