What is a Fibonacci Number?



Fibonacci numbers are the numbers in the Fibonacci sequence 0, 1, 1, 2, 3, 5, 8, 13, 21, . . . , each of which, after the second is the sum of the two previous ones.

Fibonacci numbers can also be considered as a function of non-negative integers:

       n  = 0, 1, 2, 3, 4, 5, 6,  7,  8,  9, 10, 11,  12, ...
     F(n) = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... 

The exact closed form solution for this function is called the Binet formula:

     F(n) = (Phi^n � PhiP^n)/Sqrt(5) (good for all integer n >= 0 or n < 0),
     where Phi = (1 + Sqrt(5))/2 = the Golden Ratio = 1.61803398874989484820...,
     and PhiP = Phi Prime = (1 � Sqrt(5))/2 = 1 � Phi = �1/Phi = �0.61803398874989484820...,

Since F(n) is an integer and the magnitude of PhiP^n/Sqrt(5) is less than 1/2 for n >= 0, a variant form of the formula is:

     F(n) = Round(Phi^n / Sqrt(5)), n >= 0.

If you have a Fibonacci Number you can compute its index, n = AFib(F(n)) or AFib(x) = ArcFibonacciNumber(|x|), an integer. The formula is:

     AFib(x) = 0 if |x| < 1, else
     AFib(x) = Round(Ln(sqrt(5)*|x|) / Ln(Phi)).

For example, AFib(144) = 12. This is only accurate if x is a Fibonacci number.

Fibonacci numbers can also be defined for negative n:

     F(�2*n) = �F(2*n)
     F(�2*n � 1) = F(2*n + 1)

       n  = ..., �6, �5, �4, �3, �2, �1, 0, 1, 2, 3, 4, 5, 6, ...
     F(n) = ..., �8,  5, �3,  2, �1,  1, 0, 1, 1, 2, 3, 5, 8, ...

Define IsFib(X) = 1 (True) if X is a Fibonacci number, else 0:

Set equal to 1 (True) if |x| is a Fibonacci number, else it is set to 0 (False). True iff x = 0 or z = |x| is an integer and the closed interval [Phi*z � 1/z, Phi*z + 1/z] contains a positive integer. Extra testing is performed if x < 0 and |x| is a Fibonacci number. 144, 233, and �144 are Fibonacci number, but �233 is not. For x < 0 to be a Fibonacci number, |x| must be a Fibonacci number and AFib(|x|) must be even.

IsFib2(X) = IsFib(X) by second method:

Same as IsFib(X) except true iff x = 0 or z = |x| is an integer and 5*x^2 + 4 or 5*x^2 � 4 is a perfect square.

The continuous analytic function:

     Fe(x) = (Phi^x � 1 / Phi^x) / Sqrt(5),

passes through all Fibonacci numbers of even n = x (n positive or negative).

The continuous analytic function:

     Fo(x) = (Phi^x + 1 / Phi^x) / Sqrt(5),

passes through all Fibonacci numbers of odd n = x (n positive or negative).

The continuous analytic function:

     Fib(x) = (1 + cos(x*Pi))*Fe(x)/2 + (1 � cos(x*Pi))*Fo(x)/2,

passes through all Fibonacci numbers for all n = x (n positive or negative).

This last expression can be reduced to:

     Fib(x) = (Phi^x � cos(x*Pi) / Phi^x) / sqrt(5).

Just as factorials can be generalized using the gamma function, Fibonacci numbers can be generalized using this Fib(x) function.

This formula can even be used to compute the generalized Fibonacci function of a complex variable. For example Fib(3 + 4*i) = �5248.51130,72837,20182,8... �14195.96228,83530,10885,8... * i.

It is still true that Fib(x+2) = Fib(x+1) + Fib(x). For example Fib(3.6 + 4.7*i) = Fib(2.6 + 4.7*i) + Fib(1.6 + 4.7*i).

Plot of Generalized Fibonacci numbers.

Fo(x) plot in blue
Fe(x) plot in magenta
Fib(x) plot in red

Download XCCalc - Extra Precision Floating-Point Complex Calculator

See: Fibonacci Number -- From MathWorld
And: Wolfram Function Definition -- Fibonacci
And: Fibonacci numbers -- From WikipediA
And: Generalizations of Fibonacci numbers -- From WikipediA

Return to Fibonacci Numbers
Return to Number Theory, Algorithms, and Real Functions
Return to Harry's Home Page


Copyleft notice by author: Harry J. Smith: This site is under GFDL (GNU Free Documentation License) and GPL (GNU General Public License) and Wikipedia has permission to use material from this site.


This page accessed times since October 20, 2004.
Page created by: [email protected]
Changes last made on Saturday, 04-Apr-09 13:55:10 PDT

Hosted by www.Geocities.ws

1