Fibonacci

Fibonacci[n]

gives the Fibonacci number .

Fibonacci[n,x]

gives the Fibonacci polynomial .

Details

  • Mathematical function, suitable for both symbolic and numerical manipulation.
  • The satisfy the recurrence relation with .
  • For any complex value of n, the are given by the general formula , where is the golden ratio.
  • The Fibonacci polynomial is the coefficient of in the expansion of .
  • The Fibonacci polynomials satisfy the recurrence relation .
  • FullSimplify and FunctionExpand include transformation rules for combinations of Fibonacci numbers with symbolic arguments when the arguments are specified to be integers using nIntegers.
  • Fibonacci can be evaluated to arbitrary numerical precision.
  • Fibonacci automatically threads over lists.

Examples

open allclose all

Basic Examples  (6)

Compute Fibonacci numbers:

Plot over a subset of the reals:

Plot over a subset of the complexes:

Series expansion at the origin:

Series expansion at Infinity:

Series expansion at a singular point:

Scope  (34)

Numerical Evaluation  (4)

Evaluate numerically:

Evaluate to high precision:

The precision of the output tracks the precision of the input:

Complex number inputs:

Evaluate efficiently at high precision:

Specific Values  (6)

Values of Fibonacci at fixed points:

Fibonacci polynomial for symbolic n and x:

Values at zero:

Find the value of in which TemplateBox[{3, x}, Fibonacci2]=5:

Compute the Fibonacci[7,x] polynomial:

Compute Fibonacci[1/2,x]:

Visualization  (5)

Plot the Fibonacci function:

Plot the Fibonacci polynomial for various orders:

Plot the real part of TemplateBox[{3, {x, +, iy}}, Fibonacci2]:

Plot the imaginary part of TemplateBox[{3, {x, +, iy}}, Fibonacci2]:

Plot as real parts of two parameters vary:

Types 2 and 3 of Fibonacci polynomial have different branch cut structures:

Function Properties  (7)

Fibonacci is defined for all real and complex values:

Approximate function range of Fibonacci:

Fibonacci polynomial of an even order is odd:

Fibonacci polynomial of an odd order is even:

Fibonacci has the mirror property TemplateBox[{n}, Fibonacci](z)=TemplateBox[{n}, Fibonacci](z):

Fibonacci threads elementwise over lists:

TraditionalForm formatting:

Differentiation  (3)

First derivatives with respect to n:

First derivative with respect to x:

Higher derivatives with respect to n:

Plot the higher derivatives with respect to n:

Formula for the ^(th) derivative with respect to n:

Integration  (3)

Compute the indefinite integral using Integrate:

Definite integral:

More integrals:

Series Expansions  (4)

Find the Taylor expansion using Series:

Plots of the first three approximations around :

General term in the series expansion using SeriesCoefficient:

Find the series expansion at Infinity:

Taylor expansion at a generic point:

Function Identities and Simplifications  (2)

The ordinary generating function of Fibonacci:

Recurrence relation:

Generalizations & Extensions  (2)

Fibonacci polynomials:

General series expansion at infinity:

Applications  (13)

Solve the Fibonacci recurrence equation:

Find ratios of successive Fibonacci numbers:

Compare with continued fractions:

Convergence to the golden ratio:

Fibonacci substitution system:

Fibonomial coefficients:

Calculate the number of ways to write an integer as a sum of Fibonacci numbers :

Plot the counts for the first hundred integers:

Lamé's theorem bounds the number of steps of the Euclidean algorithm for calculating :

Plot the maximal number of steps:

Find the first Fibonacci number above 1000000:

Plot the discrete inverse of Fibonacci numbers:

Plot of the absolute value of Fibonacci over the complex plane:

Find the number of factors of Fibonacci polynomials:

If divides TemplateBox[{m}, Fibonacci], then TemplateBox[{n}, Fibonacci] divides TemplateBox[{TemplateBox[{m}, Fibonacci]}, Fibonacci]:

This is a particular case of a more general identity gcd(TemplateBox[{n}, Fibonacci],TemplateBox[{k}, Fibonacci])=TemplateBox[{{gcd, (, {n, ,, k}, )}}, Fibonacci]:

The sequence of TemplateBox[{TemplateBox[{n}, Fibonacci], m}, Mod] is periodic with respect to for a fixed natural number :

For , the period equals :

Build Zeckendorf's representation of a positive integer [MathWorld]:

Define Fibonacci multiplication for positive integers:

Fibonacci multiplication table:

Verify that the Fibonacci multiplication is associative:

Properties & Relations  (15)

Fibonacci Numbers  (13)

Expand in terms of elementary functions:

Limiting ratio:

Explicit recursive definition:

Explicit statespace recursive definition:

Closedform solution using MatrixPower:

Simplify expressions involving Fibonacci numbers:

Symbolic summation:

Generating function:

Fibonacci numbers as coefficients:

Express a fractional Fibonacci number as an algebraic number:

Fibonacci can be represented as a DifferenceRoot:

General term in the series expansion of Fibonacci:

The generating function for Fibonacci:

FindSequenceFunction can recognize the Fibonacci sequence:

The exponential generating function for Fibonacci:

Fibonacci Polynomials  (2)

Expand in terms of elementary functions:

Explicitly construct Fibonacci polynomials:

Possible Issues  (3)

Large arguments can give results too large to be computed explicitly:

Results for integer arguments may not hold for non-integers:

Matrix power representation is valid only for integers:

Neat Examples  (8)

Fibonacci numbers modulo 10:

Fibonacci modulo n [more info]:

Count the number of 1, 2, ..., 9, 0 digits in the 1,000,000^(th) Fibonacci number:

Contours of vanishing real and imaginary parts of Fibonacci:

LogPlot of positive and negative Fibonacci numbers:

While the Fibonacci numbers are nondecreasing for non-negative arguments, the Fibonacci function possesses a single local minimum:

Since the generating function is rational, these sums come out as rational numbers:

Introduced in 1996
 (3.0)
 |
Updated in 1999
 (4.0)
2000
 (4.1)
2002
 (4.2)