In mathematics, the Fibonacci numbers form a sequence defined recursively by:
That is, after two starting values, each number is the sum of the two preceding numbers.
The Fibonacci sequence has been studied extensively and generalized in many ways, for example, by starting with other numbers than 0 and 1, by adding more than two numbers to generate the next number, or by adding objects other than numbers.
Using Fn − 2 = Fn − Fn − 1, one can extend the Fibonacci numbers to negative integers. So we get:
and F−n = (−1)n + 1Fn.
See also Negafibonacci.
There are a number of possible generalizations of the Fibonacci numbers which include the real numbers (and sometimes the complex numbers) in their domain. These each involve the golden ratio φ, and are based on Binet's formula
The analytic function
has the property that Fe(n) = Fn for even integers n. Similarly, the analytic function:
satisfies Fo(n) = Fn for odd integers n.
Finally, putting these together, the analytic function
satisfies Fib(n) = Fn for all integers n.
Since Fib(z + 2) = Fib(z + 1) + Fib(z) for all complex numbers z, this function also provides an extension of the Fibonacci sequence to the entire complex plane. Hence we can calculate the generalized Fibonacci function of a complex variable, for example,
The term Fibonacci sequence is also applied more generally to any function g from the integers to a field for which g(n + 2) = g(n) + g(n + 1). These functions are precisely those of the form g(n) = F(n)g(1) + F(n − 1)g(0), so the Fibonacci sequences form a vector space with the functions F(n) and F(n − 1) as a basis.