In mathematics, the Fibonacci sequence is a sequence in which each element is the sum of the two elements that precede it. Numbers that are part of the Fibonacci sequence are known as Fibonacci numbers, commonly denoted Fn . Many writers begin the sequence with 0 and 1, although some authors start it from 1 and 1 and some (as did Fibonacci) from 1 and 2. Starting from 0 and 1, the sequence begins
- 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... (sequence A000045 in the OEIS)
The Fibonacci numbers were first described in Indian mathematics as early as 200 BC in work by Pingala on enumerating possible patterns of Sanskrit poetry formed from syllables of two lengths. They are named after the Italian mathematician Leonardo of Pisa, also known as Fibonacci, who introduced the sequence to Western European mathematics in his 1202 book Liber Abaci.
Fibonacci numbers appear unexpectedly often in mathematics, so much so that there is an entire journal dedicated to their study, the Fibonacci Quarterly. Applications of Fibonacci numbers include computer algorithms such as the Fibonacci search technique and the Fibonacci heap data structure, and graphs called Fibonacci cubes used for interconnecting parallel and distributed systems. They also appear in biological settings, such as branching in trees, the arrangement of leaves on a stem, the fruit sprouts of a pineapple, the flowering of an artichoke, and the arrangement of a pine cone's bracts, though they do not occur in all species.
Fibonacci numbers are also strongly related to the golden ratio: Binet's formula expresses the n-th Fibonacci number in terms of n and the golden ratio, and implies that the ratio of two consecutive Fibonacci numbers tends to the golden ratio as n increases. Fibonacci numbers are also closely related to Lucas numbers, which obey the same recurrence relation and with the Fibonacci numbers form a complementary pair of Lucas sequences.
Definition
The Fibonacci numbers may be defined by the recurrence relation and for n > 1.
Under some older definitions, the value is omitted, so that the sequence starts with and the recurrence is valid for n > 2.
The first 20 Fibonacci numbers Fn are:
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
History
India
The Fibonacci sequence appears in Indian mathematics, in connection with Sanskrit prosody. In the Sanskrit poetic tradition, there was interest in enumerating all patterns of long (L) syllables of 2 units duration, juxtaposed with short (S) syllables of 1 unit duration. Counting the different patterns of successive L and S with a given total duration results in the Fibonacci numbers: the number of patterns of duration m units is Fm+1.
Knowledge of the Fibonacci sequence was expressed as early as Pingala (c. 450 BC–200 BC). Singh cites Pingala's cryptic formula misrau cha ("the two are mixed") and scholars who interpret it in context as saying that the number of patterns for m beats (Fm+1) is obtained by adding one [S] to the Fm cases and one [L] to the Fm−1 cases.Bharata Muni also expresses knowledge of the sequence in the Natya Shastra (c. 100 BC–c. 350 AD). However, the clearest exposition of the sequence arises in the work of Virahanka (c. 700 AD), whose own work is lost, but is available in a quotation by Gopala (c. 1135):
Variations of two earlier meters [is the variation] ... For example, for [a meter of length] four, variations of meters of two [and] three being mixed, five happens. [works out examples 8, 13, 21] ... In this way, the process should be followed in all mātrā-vṛttas [prosodic combinations].
Hemachandra (c. 1150) is credited with knowledge of the sequence as well, writing that "the sum of the last and the one before the last is the number ... of the next mātrā-vṛtta."
Europe
The Fibonacci sequence first appears in the book Liber Abaci (The Book of Calculation, 1202) by Fibonacci where it is used to calculate the growth of rabbit populations. Fibonacci considers the growth of an idealized (biologically unrealistic) rabbit population, assuming that: a newly born breeding pair of rabbits are put in a field; each breeding pair mates at the age of one month, and at the end of their second month they always produce another pair of rabbits; and rabbits never die, but continue breeding forever. Fibonacci posed the rabbit math problem: how many pairs will there be in one year?
- At the end of the first month, they mate, but there is still only 1 pair.
- At the end of the second month they produce a new pair, so there are 2 pairs in the field.
- At the end of the third month, the original pair produce a second pair, but the second pair only mate to gestate for a month, so there are 3 pairs in all.
- At the end of the fourth month, the original pair has produced yet another new pair, and the pair born two months ago also produces their first pair, making 5 pairs.
At the end of the n-th month, the number of pairs of rabbits is equal to the number of mature pairs (that is, the number of pairs in month n – 2) plus the number of pairs alive last month (month n – 1). The number in the n-th month is the n-th Fibonacci number.
The name "Fibonacci sequence" was first used by the 19th-century number theorist Édouard Lucas.
Relation to the golden ratio
Closed-form expression
Like every sequence defined by a homogeneous linear recurrence with constant coefficients, the Fibonacci numbers have a closed-form expression. It has become known as Binet's formula, named after French mathematician Jacques Philippe Marie Binet, though it was already known by Abraham de Moivre and Daniel Bernoulli:
where
is the golden ratio, and is its conjugate:
Since , this formula can also be written as
To see the relation between the sequence and these constants, note that and are both solutions of the equation and thus so the powers of and satisfy the Fibonacci recursion. In other words,
It follows that for any values a and b, the sequence defined by
satisfies the same recurrence,
If a and b are chosen so that U0 = 0 and U1 = 1 then the resulting sequence Un must be the Fibonacci sequence. This is the same as requiring a and b satisfy the system of equations:
which has solution
producing the required formula.
Taking the starting values U0 and U1 to be arbitrary constants, a more general solution is:
where
Computation by rounding
Since for all n ≥ 0, the number Fn is the closest integer to . Therefore, it can be found by rounding, using the nearest integer function:
In fact, the rounding error quickly becomes very small as n grows, being less than 0.1 for n ≥ 4, and less than 0.01 for n ≥ 8. This formula is easily inverted to find an index of a Fibonacci number F:
Instead using the floor function gives the largest index of a Fibonacci number that is not greater than F: where , , and .
Magnitude
Since Fn is asymptotic to , the number of digits in Fn is asymptotic to . As a consequence, for every integer d > 1 there are either 4 or 5 Fibonacci numbers with d decimal digits.
More generally, in the base b representation, the number of digits in Fn is asymptotic to
Limit of consecutive quotients
Johannes Kepler observed that the ratio of consecutive Fibonacci numbers converges. He wrote that "as 5 is to 8 so is 8 to 13, practically, and as 8 is to 13, so is 13 to 21 almost", and concluded that these ratios approach the golden ratio
This convergence holds regardless of the starting values and , unless . This can be verified using Binet's formula. For example, the initial values 3 and 2 generate the sequence 3, 2, 5, 7, 12, 19, 31, 50, 81, 131, 212, 343, 555, ... . The ratio of consecutive elements in this sequence shows the same convergence towards the golden ratio.
In general, , because the ratios between consecutive Fibonacci numbers approaches .
Decomposition of powers
Since the golden ratio satisfies the equation
this expression can be used to decompose higher powers as a linear function of lower powers, which in turn can be decomposed all the way down to a linear combination of and 1. The resulting recurrence relationships yield Fibonacci numbers as the linear coefficients: This equation can be proved by induction on n ≥ 1: For , it is also the case that and it is also the case that
These expressions are also true for n < 1 if the Fibonacci sequence Fn is extended to negative integers using the Fibonacci rule
Identification
Binet's formula provides a proof that a positive integer x is a Fibonacci number if and only if at least one of or is a perfect square. This is because Binet's formula, which can be written as , can be multiplied by and solved as a quadratic equation in via the quadratic formula:
Comparing this to , it follows that
In particular, the left-hand side is a perfect square.
Matrix form
A 2-dimensional system of linear difference equations that describes the Fibonacci sequence is
alternatively denoted
which yields . The eigenvalues of the matrix A are and corresponding to the respective eigenvectors
As the initial value is
it follows that the nth element is
From this, the nth element in the Fibonacci series may be read off directly as a closed-form expression:
Equivalently, the same computation may be performed by diagonalization of A through use of its eigendecomposition:
where
The closed-form expression for the nth element in the Fibonacci series is therefore given by
which again yields
The matrix A has a determinant of −1, and thus it is a 2 × 2 unimodular matrix.
This property can be understood in terms of the continued fraction representation for the golden ratio φ:
The convergents of the continued fraction for φ are ratios of successive Fibonacci numbers: φn = Fn+1 / Fn is the n-th convergent, and the (n + 1)-st convergent can be found from the recurrence relation φn+1 = 1 + 1 / φn. The matrix formed from successive convergents of any continued fraction has a determinant of +1 or −1. The matrix representation gives the following closed-form expression for the Fibonacci numbers:
For a given n, this matrix can be computed in O(log n) arithmetic operations, using the exponentiation by squaring method.
Taking the determinant of both sides of this equation yields Cassini's identity,
Moreover, since AnAm = An+m for any square matrix A, the following identities can be derived (they are obtained from two different coefficients of the matrix product, and one may easily deduce the second one from the first one by changing n into n + 1),
In particular, with m = n,
These last two identities provide a way to compute Fibonacci numbers recursively in O(log n) arithmetic operations. This matches the time for computing the n-th Fibonacci number from the closed-form matrix formula, but with fewer redundant steps if one avoids recomputing an already computed Fibonacci number (recursion with memoization).
Combinatorial identities
Combinatorial proofs
Most identities involving Fibonacci numbers can be proved using combinatorial arguments using the fact that can be interpreted as the number of (possibly empty) sequences of 1s and 2s whose sum is . This can be taken as the definition of with the conventions , meaning no such sequence exists whose sum is −1, and , meaning the empty sequence "adds up" to 0. In the following, is the cardinality of a set:
In this manner the recurrence relation may be understood by dividing the sequences into two non-overlapping sets where all sequences either begin with 1 or 2: Excluding the first element, the remaining terms in each sequence sum to or and the cardinality of each set is or giving a total of sequences, showing this is equal to .
In a similar manner it may be shown that the sum of the first Fibonacci numbers up to the n-th is equal to the (n + 2)-th Fibonacci number minus 1. In symbols:
This may be seen by dividing all sequences summing to based on the location of the first 2. Specifically, each set consists of those sequences that start until the last two sets each with cardinality 1.
Following the same logic as before, by summing the cardinality of each set we see that
... where the last two terms have the value . From this it follows that .
A similar argument, grouping the sums by the position of the first 1 rather than the first 2 gives two more identities: and In words, the sum of the first Fibonacci numbers with odd index up to is the (2n)-th Fibonacci number, and the sum of the first Fibonacci numbers with even index up to is the (2n + 1)-th Fibonacci number minus 1.
A different trick may be used to prove or in words, the sum of the squares of the first Fibonacci numbers up to is the product of the n-th and (n + 1)-th Fibonacci numbers. To see this, begin with a Fibonacci rectangle of size and decompose it into squares of size ; from this the identity follows by comparing areas:
Symbolic method
The sequence is also considered using the symbolic method. More precisely, this sequence corresponds to a specifiable combinatorial class. The specification of this sequence is . Indeed, as stated above, the -th Fibonacci number equals the number of combinatorial compositions (ordered partitions) of using terms 1 and 2.
It follows that the ordinary generating function of the Fibonacci sequence, , is the rational function
Induction proofs
Fibonacci identities often can be easily proved using mathematical induction.
For example, reconsider Adding to both sides gives
and so we have the formula for
Similarly, add to both sides of to give
Binet formula proofs
The Binet formula is This can be used to prove Fibonacci identities.
For example, to prove that note that the left hand side multiplied by becomes as required, using the facts and to simplify the equations.
Other identities
Numerous other identities can be derived using various methods. Here are some of them:
Cassini's and Catalan's identities
Cassini's identity states that Catalan's identity is a generalization:
d'Ocagne's identity
where Ln is the n-th Lucas number. The last is an identity for doubling n; other identities of this type are by Cassini's identity.
These can be found experimentally using lattice reduction, and are useful in setting up the special number field sieve to factorize a Fibonacci number.
More generally,
or alternatively
Putting k = 2 in this formula, one gets again the formulas of the end of above section Matrix form.
Generating function
The generating function of the Fibonacci sequence is the power series
This series is convergent for any complex number satisfying and its sum has a simple closed form:
This can be proved by multiplying by :
where all terms involving for cancel out because of the defining Fibonacci recurrence relation.
The partial fraction decomposition is given by where is the golden ratio and is its conjugate.
The related function is the generating function for the negafibonacci numbers, and satisfies the functional equation
Using equal to any of 0.01, 0.001, 0.0001, etc. lays out the first Fibonacci numbers in the decimal expansion of . For example,
Reciprocal sums
Infinite sums over reciprocal Fibonacci numbers can sometimes be evaluated in terms of theta functions. For example, the sum of every odd-indexed reciprocal Fibonacci number can be written as
and the sum of squared reciprocal Fibonacci numbers as
If we add 1 to each Fibonacci number in the first sum, there is also the closed form
and there is a nested sum of squared Fibonacci numbers giving the reciprocal of the golden ratio,
The sum of all even-indexed reciprocal Fibonacci numbers is with the Lambert series since
So the reciprocal Fibonacci constant is
Moreover, this number has been proved irrational by .
Millin's series gives the identity which follows from the closed form for its partial sums as N tends to infinity:
Primes and divisibility
Divisibility properties
Every third number of the sequence is even (a multiple of ) and, more generally, every k-th number of the sequence is a multiple of Fk. Thus the Fibonacci sequence is an example of a divisibility sequence. In fact, the Fibonacci sequence satisfies the stronger divisibility property where gcd is the greatest common divisor function. (This relation is different if a different indexing convention is used, such as the one that starts the sequence with and .)
In particular, any three consecutive Fibonacci numbers are pairwise coprime because both and . That is,
for every n.
Every prime number p divides a Fibonacci number that can be determined by the value of p modulo 5. If p is congruent to 1 or 4 modulo 5, then p divides Fp−1, and if p is congruent to 2 or 3 modulo 5, then, p divides Fp+1. The remaining case is that p = 5, and in this case p divides Fp.
These cases can be combined into a single, non-piecewise formula, using the Legendre symbol:
Primality testing
The above formula can be used as a primality test in the sense that if where the Legendre symbol has been replaced by the Jacobi symbol, then this is evidence that n is a prime, and if it fails to hold, then n is definitely not a prime. If n is composite and satisfies the formula, then n is a Fibonacci pseudoprime. When m is large – say a 500-bit number – then we can calculate Fm (mod n) efficiently using the matrix form. Thus
Here the matrix power Am is calculated using modular exponentiation, which can be adapted to matrices.
Fibonacci primes
A Fibonacci prime is a Fibonacci number that is prime. The first few are:
- 2, 3, 5, 13, 89, 233, 1597, 28657, 514229, ...
Fibonacci primes with thousands of digits have been found, but it is not known whether there are infinitely many.
Fkn is divisible by Fn, so, apart from F4 = 3, any Fibonacci prime must have a prime index. As there are arbitrarily long runs of composite numbers, there are therefore also arbitrarily long runs of composite Fibonacci numbers.
No Fibonacci number greater than F6 = 8 is one greater or one less than a prime number.
The only nontrivial square Fibonacci number is 144. Attila Pethő proved in 2001 that there is only a finite number of perfect power Fibonacci numbers. In 2006, Y. Bugeaud, M. Mignotte, and S. Siksek proved that 8 and 144 are the only such non-trivial perfect powers.
1, 3, 21, and 55 are the only triangular Fibonacci numbers, which was conjectured by Vern Hoggatt and proved by Luo Ming.
No Fibonacci number can be a perfect number. More generally, no Fibonacci number other than 1 can be multiply perfect, and no ratio of two Fibonacci numbers can be perfect.
Prime divisors
With the exceptions of 1, 8 and 144 (F1 = F2, F6 and F12) every Fibonacci number has a prime factor that is not a factor of any smaller Fibonacci number (Carmichael's theorem). As a result, 8 and 144 (F6 and F12) are the only Fibonacci numbers that are the product of other Fibonacci numbers.
The divisibility of Fibonacci numbers by a prime p is related to the Legendre symbol which is evaluated as follows:
If p is a prime number then
For example,
It is not known whether there exists a prime p such that
Such primes (if there are any) would be called Wall–Sun–Sun primes.
Also, if p ≠ 5 is an odd prime number then:
Example 1. p = 7, in this case p ≡ 3 (mod 4) and we have:
Example 2. p = 11, in this case p ≡ 3 (mod 4) and we have:
Example 3. p = 13, in this case p ≡ 1 (mod 4) and we have:
Example 4. p = 29, in this case p ≡ 1 (mod 4) and we have:
In mathematics the Fibonacci sequence is a sequence in which each element is the sum of the two elements that precede it Numbers that are part of the Fibonacci sequence are known as Fibonacci numbers commonly denoted Fn Many writers begin the sequence with 0 and 1 although some authors start it from 1 and 1 and some as did Fibonacci from 1 and 2 Starting from 0 and 1 the sequence begins 0 1 1 2 3 5 8 13 21 34 55 89 144 sequence A000045 in the OEIS A tiling with squares whose side lengths are successive Fibonacci numbers 1 1 2 3 5 8 13 and 21 The Fibonacci numbers were first described in Indian mathematics as early as 200 BC in work by Pingala on enumerating possible patterns of Sanskrit poetry formed from syllables of two lengths They are named after the Italian mathematician Leonardo of Pisa also known as Fibonacci who introduced the sequence to Western European mathematics in his 1202 book Liber Abaci Fibonacci numbers appear unexpectedly often in mathematics so much so that there is an entire journal dedicated to their study the Fibonacci Quarterly Applications of Fibonacci numbers include computer algorithms such as the Fibonacci search technique and the Fibonacci heap data structure and graphs called Fibonacci cubes used for interconnecting parallel and distributed systems They also appear in biological settings such as branching in trees the arrangement of leaves on a stem the fruit sprouts of a pineapple the flowering of an artichoke and the arrangement of a pine cone s bracts though they do not occur in all species Fibonacci numbers are also strongly related to the golden ratio Binet s formula expresses the n th Fibonacci number in terms of n and the golden ratio and implies that the ratio of two consecutive Fibonacci numbers tends to the golden ratio as n increases Fibonacci numbers are also closely related to Lucas numbers which obey the same recurrence relation and with the Fibonacci numbers form a complementary pair of Lucas sequences DefinitionThe Fibonacci spiral an approximation of the golden spiral created by drawing circular arcs connecting the opposite corners of squares in the Fibonacci tiling see preceding image The Fibonacci numbers may be defined by the recurrence relationF0 0 F1 1 displaystyle F 0 0 quad F 1 1 and Fn Fn 1 Fn 2 displaystyle F n F n 1 F n 2 for n gt 1 Under some older definitions the value F0 0 displaystyle F 0 0 is omitted so that the sequence starts with F1 F2 1 displaystyle F 1 F 2 1 and the recurrence Fn Fn 1 Fn 2 displaystyle F n F n 1 F n 2 is valid for n gt 2 The first 20 Fibonacci numbers Fn are F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16 F17 F18 F190 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181HistoryIndia Thirteen F7 ways of arranging long and short syllables in a cadence of length six Eight F6 end with a short syllable and five F5 end with a long syllable The Fibonacci sequence appears in Indian mathematics in connection with Sanskrit prosody In the Sanskrit poetic tradition there was interest in enumerating all patterns of long L syllables of 2 units duration juxtaposed with short S syllables of 1 unit duration Counting the different patterns of successive L and S with a given total duration results in the Fibonacci numbers the number of patterns of duration m units is Fm 1 Knowledge of the Fibonacci sequence was expressed as early as Pingala c 450 BC 200 BC Singh cites Pingala s cryptic formula misrau cha the two are mixed and scholars who interpret it in context as saying that the number of patterns for m beats Fm 1 is obtained by adding one S to the Fm cases and one L to the Fm 1 cases Bharata Muni also expresses knowledge of the sequence in the Natya Shastra c 100 BC c 350 AD However the clearest exposition of the sequence arises in the work of Virahanka c 700 AD whose own work is lost but is available in a quotation by Gopala c 1135 Variations of two earlier meters is the variation For example for a meter of length four variations of meters of two and three being mixed five happens works out examples 8 13 21 In this way the process should be followed in all matra vṛttas prosodic combinations Hemachandra c 1150 is credited with knowledge of the sequence as well writing that the sum of the last and the one before the last is the number of the next matra vṛtta Europe A page of Fibonacci s Liber Abaci from the Biblioteca Nazionale di Firenze showing in box on right 13 entries of the Fibonacci sequence the indices from present to XII months as Latin ordinals and Roman numerals and the numbers of rabbit pairs as Hindu Arabic numerals starting with 1 2 3 5 and ending with 377 The Fibonacci sequence first appears in the book Liber Abaci The Book of Calculation 1202 by Fibonacci where it is used to calculate the growth of rabbit populations Fibonacci considers the growth of an idealized biologically unrealistic rabbit population assuming that a newly born breeding pair of rabbits are put in a field each breeding pair mates at the age of one month and at the end of their second month they always produce another pair of rabbits and rabbits never die but continue breeding forever Fibonacci posed the rabbit math problem how many pairs will there be in one year At the end of the first month they mate but there is still only 1 pair At the end of the second month they produce a new pair so there are 2 pairs in the field At the end of the third month the original pair produce a second pair but the second pair only mate to gestate for a month so there are 3 pairs in all At the end of the fourth month the original pair has produced yet another new pair and the pair born two months ago also produces their first pair making 5 pairs At the end of the n th month the number of pairs of rabbits is equal to the number of mature pairs that is the number of pairs in month n 2 plus the number of pairs alive last month month n 1 The number in the n th month is the n th Fibonacci number The name Fibonacci sequence was first used by the 19th century number theorist Edouard Lucas Solution to Fibonacci rabbit problem In a growing idealized population the number of rabbit pairs form the Fibonacci sequence At the end of the nth month the number of pairs is equal to Fn Relation to the golden ratioClosed form expression Like every sequence defined by a homogeneous linear recurrence with constant coefficients the Fibonacci numbers have a closed form expression It has become known as Binet s formula named after French mathematician Jacques Philippe Marie Binet though it was already known by Abraham de Moivre and Daniel Bernoulli Fn fn psnf ps fn psn5 displaystyle F n frac varphi n psi n varphi psi frac varphi n psi n sqrt 5 where f 1 52 1 6180339887 displaystyle varphi frac 1 sqrt 5 2 approx 1 61803 39887 ldots is the golden ratio and ps displaystyle psi is its conjugate ps 1 52 1 f 1f 0 6180339887 displaystyle psi frac 1 sqrt 5 2 1 varphi 1 over varphi approx 0 61803 39887 ldots Since ps f 1 displaystyle psi varphi 1 this formula can also be written as Fn fn f n5 fn f n2f 1 displaystyle F n frac varphi n varphi n sqrt 5 frac varphi n varphi n 2 varphi 1 To see the relation between the sequence and these constants note that f displaystyle varphi and ps displaystyle psi are both solutions of the equation x2 x 1 textstyle x 2 x 1 and thus xn xn 1 xn 2 displaystyle x n x n 1 x n 2 so the powers of f displaystyle varphi and ps displaystyle psi satisfy the Fibonacci recursion In other words fn fn 1 fn 2 psn psn 1 psn 2 displaystyle begin aligned varphi n amp varphi n 1 varphi n 2 3mu psi n amp psi n 1 psi n 2 end aligned It follows that for any values a and b the sequence defined by Un afn bpsn displaystyle U n a varphi n b psi n satisfies the same recurrence Un afn bpsn a fn 1 fn 2 b psn 1 psn 2 afn 1 bpsn 1 afn 2 bpsn 2 Un 1 Un 2 displaystyle begin aligned U n amp a varphi n b psi n 3mu amp a varphi n 1 varphi n 2 b psi n 1 psi n 2 3mu amp a varphi n 1 b psi n 1 a varphi n 2 b psi n 2 3mu amp U n 1 U n 2 end aligned If a and b are chosen so that U0 0 and U1 1 then the resulting sequence Un must be the Fibonacci sequence This is the same as requiring a and b satisfy the system of equations a b 0fa psb 1 displaystyle left begin aligned a b amp 0 varphi a psi b amp 1 end aligned right which has solution a 1f ps 15 b a displaystyle a frac 1 varphi psi frac 1 sqrt 5 quad b a producing the required formula Taking the starting values U0 and U1 to be arbitrary constants a more general solution is Un afn bpsn displaystyle U n a varphi n b psi n where a U1 U0ps5 b U0f U15 displaystyle begin aligned a amp frac U 1 U 0 psi sqrt 5 3mu b amp frac U 0 varphi U 1 sqrt 5 end aligned Computation by rounding Since psn5 lt 12 textstyle left frac psi n sqrt 5 right lt frac 1 2 for all n 0 the number Fn is the closest integer to fn5 displaystyle frac varphi n sqrt 5 Therefore it can be found by rounding using the nearest integer function Fn fn5 n 0 displaystyle F n left lfloor frac varphi n sqrt 5 right rceil n geq 0 In fact the rounding error quickly becomes very small as n grows being less than 0 1 for n 4 and less than 0 01 for n 8 This formula is easily inverted to find an index of a Fibonacci number F n F logf 5F F 1 displaystyle n F left lfloor log varphi sqrt 5 F right rceil F geq 1 Instead using the floor function gives the largest index of a Fibonacci number that is not greater than F nlargest F logf 5 F 1 2 F 0 displaystyle n mathrm largest F left lfloor log varphi sqrt 5 F 1 2 right rfloor F geq 0 where logf x ln x ln f log10 x log10 f displaystyle log varphi x ln x ln varphi log 10 x log 10 varphi ln f 0 481211 displaystyle ln varphi 0 481211 ldots and log10 f 0 208987 displaystyle log 10 varphi 0 208987 ldots Magnitude Since Fn is asymptotic to fn 5 displaystyle varphi n sqrt 5 the number of digits in Fn is asymptotic to nlog10 f 0 2090n displaystyle n log 10 varphi approx 0 2090 n As a consequence for every integer d gt 1 there are either 4 or 5 Fibonacci numbers with d decimal digits More generally in the base b representation the number of digits in Fn is asymptotic to nlogb f nlog flog b displaystyle n log b varphi frac n log varphi log b Limit of consecutive quotients Johannes Kepler observed that the ratio of consecutive Fibonacci numbers converges He wrote that as 5 is to 8 so is 8 to 13 practically and as 8 is to 13 so is 13 to 21 almost and concluded that these ratios approach the golden ratio f displaystyle varphi colon limn Fn 1Fn f displaystyle lim n to infty frac F n 1 F n varphi This convergence holds regardless of the starting values U0 displaystyle U 0 and U1 displaystyle U 1 unless U1 U0 f displaystyle U 1 U 0 varphi This can be verified using Binet s formula For example the initial values 3 and 2 generate the sequence 3 2 5 7 12 19 31 50 81 131 212 343 555 The ratio of consecutive elements in this sequence shows the same convergence towards the golden ratio In general limn Fn mFn fm displaystyle lim n to infty frac F n m F n varphi m because the ratios between consecutive Fibonacci numbers approaches f displaystyle varphi Successive tilings of the plane and a graph of approximations to the golden ratio calculated by dividing each Fibonacci number by the previous Decomposition of powers Since the golden ratio satisfies the equation f2 f 1 displaystyle varphi 2 varphi 1 this expression can be used to decompose higher powers fn displaystyle varphi n as a linear function of lower powers which in turn can be decomposed all the way down to a linear combination of f displaystyle varphi and 1 The resulting recurrence relationships yield Fibonacci numbers as the linear coefficients fn Fnf Fn 1 displaystyle varphi n F n varphi F n 1 This equation can be proved by induction on n 1 fn 1 Fnf Fn 1 f Fnf2 Fn 1f Fn f 1 Fn 1f Fn Fn 1 f Fn Fn 1f Fn displaystyle varphi n 1 F n varphi F n 1 varphi F n varphi 2 F n 1 varphi F n varphi 1 F n 1 varphi F n F n 1 varphi F n F n 1 varphi F n For ps 1 f displaystyle psi 1 varphi it is also the case that ps2 ps 1 displaystyle psi 2 psi 1 and it is also the case that psn Fnps Fn 1 displaystyle psi n F n psi F n 1 These expressions are also true for n lt 1 if the Fibonacci sequence Fn is extended to negative integers using the Fibonacci rule Fn Fn 2 Fn 1 displaystyle F n F n 2 F n 1 Identification Binet s formula provides a proof that a positive integer x is a Fibonacci number if and only if at least one of 5x2 4 displaystyle 5x 2 4 or 5x2 4 displaystyle 5x 2 4 is a perfect square This is because Binet s formula which can be written as Fn fn 1 nf n 5 displaystyle F n varphi n 1 n varphi n sqrt 5 can be multiplied by 5fn displaystyle sqrt 5 varphi n and solved as a quadratic equation in fn displaystyle varphi n via the quadratic formula fn Fn5 5Fn2 4 1 n2 displaystyle varphi n frac F n sqrt 5 pm sqrt 5 F n 2 4 1 n 2 Comparing this to fn Fnf Fn 1 Fn5 Fn 2Fn 1 2 displaystyle varphi n F n varphi F n 1 F n sqrt 5 F n 2F n 1 2 it follows that 5Fn2 4 1 n Fn 2Fn 1 2 displaystyle 5 F n 2 4 1 n F n 2F n 1 2 In particular the left hand side is a perfect square Matrix formA 2 dimensional system of linear difference equations that describes the Fibonacci sequence is Fk 2Fk 1 1110 Fk 1Fk displaystyle F k 2 choose F k 1 begin pmatrix 1 amp 1 1 amp 0 end pmatrix F k 1 choose F k alternatively denoted F k 1 AF k displaystyle vec F k 1 mathbf A vec F k which yields F n AnF 0 displaystyle vec F n mathbf A n vec F 0 The eigenvalues of the matrix A are f 12 1 5 displaystyle varphi tfrac 1 2 bigl 1 sqrt 5 bigr and ps f 1 12 1 5 displaystyle psi varphi 1 tfrac 1 2 bigl 1 sqrt 5 bigr corresponding to the respective eigenvectors m f1 n f 11 displaystyle vec mu varphi choose 1 quad vec nu varphi 1 choose 1 As the initial value is F 0 10 15m 15n displaystyle vec F 0 1 choose 0 frac 1 sqrt 5 vec mu frac 1 sqrt 5 vec nu it follows that the n th element is F n 15Anm 15Ann 15fnm 15 f nn 15 1 52 n f1 15 1 52 n f 11 displaystyle begin aligned vec F n amp frac 1 sqrt 5 A n vec mu frac 1 sqrt 5 A n vec nu amp frac 1 sqrt 5 varphi n vec mu frac 1 sqrt 5 varphi n vec nu amp cfrac 1 sqrt 5 left cfrac 1 sqrt 5 2 right n varphi choose 1 cfrac 1 sqrt 5 left cfrac 1 sqrt 5 2 right n varphi 1 choose 1 end aligned From this the n th element in the Fibonacci series may be read off directly as a closed form expression Fn 15 1 52 n 15 1 52 n displaystyle F n cfrac 1 sqrt 5 left cfrac 1 sqrt 5 2 right n cfrac 1 sqrt 5 left cfrac 1 sqrt 5 2 right n Equivalently the same computation may be performed by diagonalization of A through use of its eigendecomposition A SLS 1 An SLnS 1 displaystyle begin aligned A amp S Lambda S 1 3mu A n amp S Lambda n S 1 end aligned where L f00 f 1 S f f 111 displaystyle Lambda begin pmatrix varphi amp 0 0 amp varphi 1 end pmatrix quad S begin pmatrix varphi amp varphi 1 1 amp 1 end pmatrix The closed form expression for the n th element in the Fibonacci series is therefore given by Fn 1Fn An F1F0 SLnS 1 F1F0 S fn00 f n S 1 F1F0 f f 111 fn00 f n 15 1f 1 1f 10 displaystyle begin aligned F n 1 choose F n amp A n F 1 choose F 0 amp S Lambda n S 1 F 1 choose F 0 amp S begin pmatrix varphi n amp 0 0 amp varphi n end pmatrix S 1 F 1 choose F 0 amp begin pmatrix varphi amp varphi 1 1 amp 1 end pmatrix begin pmatrix varphi n amp 0 0 amp varphi n end pmatrix frac 1 sqrt 5 begin pmatrix 1 amp varphi 1 1 amp varphi end pmatrix 1 choose 0 end aligned which again yields Fn fn f n5 displaystyle F n cfrac varphi n varphi n sqrt 5 The matrix A has a determinant of 1 and thus it is a 2 2 unimodular matrix This property can be understood in terms of the continued fraction representation for the golden ratio f f 1 11 11 11 displaystyle varphi 1 cfrac 1 1 cfrac 1 1 cfrac 1 1 ddots The convergents of the continued fraction for f are ratios of successive Fibonacci numbers fn Fn 1 Fn is the n th convergent and the n 1 st convergent can be found from the recurrence relation fn 1 1 1 fn The matrix formed from successive convergents of any continued fraction has a determinant of 1 or 1 The matrix representation gives the following closed form expression for the Fibonacci numbers 1110 n Fn 1FnFnFn 1 displaystyle begin pmatrix 1 amp 1 1 amp 0 end pmatrix n begin pmatrix F n 1 amp F n F n amp F n 1 end pmatrix For a given n this matrix can be computed in O log n arithmetic operations using the exponentiation by squaring method Taking the determinant of both sides of this equation yields Cassini s identity 1 n Fn 1Fn 1 Fn2 displaystyle 1 n F n 1 F n 1 F n 2 Moreover since AnAm An m for any square matrix A the following identities can be derived they are obtained from two different coefficients of the matrix product and one may easily deduce the second one from the first one by changing n into n 1 FmFn Fm 1Fn 1 Fm n 1 FmFn 1 Fm 1Fn Fm n displaystyle begin aligned F m F n F m 1 F n 1 amp F m n 1 3mu F m F n 1 F m 1 F n amp F m n end aligned In particular with m n F2n 1 Fn2 Fn 12F2n 1 Fn 1 Fn 1 Fn 2Fn 1 Fn Fn 2Fn 1 Fn Fn displaystyle begin aligned F 2n 1 amp F n 2 F n 1 2 6mu F 2n phantom 1 amp F n 1 F n 1 F n 3mu amp 2F n 1 F n F n 3mu amp 2F n 1 F n F n end aligned These last two identities provide a way to compute Fibonacci numbers recursively in O log n arithmetic operations This matches the time for computing the n th Fibonacci number from the closed form matrix formula but with fewer redundant steps if one avoids recomputing an already computed Fibonacci number recursion with memoization Combinatorial identitiesCombinatorial proofs Most identities involving Fibonacci numbers can be proved using combinatorial arguments using the fact that Fn displaystyle F n can be interpreted as the number of possibly empty sequences of 1s and 2s whose sum is n 1 displaystyle n 1 This can be taken as the definition of Fn displaystyle F n with the conventions F0 0 displaystyle F 0 0 meaning no such sequence exists whose sum is 1 and F1 1 displaystyle F 1 1 meaning the empty sequence adds up to 0 In the following displaystyle is the cardinality of a set F0 0 displaystyle F 0 0 F1 1 displaystyle F 1 1 F2 1 1 displaystyle F 2 1 1 F3 2 1 1 2 displaystyle F 3 2 1 1 2 F4 3 1 1 1 1 2 2 1 displaystyle F 4 3 1 1 1 1 2 2 1 F5 5 1 1 1 1 1 1 2 1 2 1 2 1 1 2 2 displaystyle F 5 5 1 1 1 1 1 1 2 1 2 1 2 1 1 2 2 In this manner the recurrence relation Fn Fn 1 Fn 2 displaystyle F n F n 1 F n 2 may be understood by dividing the Fn displaystyle F n sequences into two non overlapping sets where all sequences either begin with 1 or 2 Fn 1 1 2 2 displaystyle F n 1 1 2 2 Excluding the first element the remaining terms in each sequence sum to n 2 displaystyle n 2 or n 3 displaystyle n 3 and the cardinality of each set is Fn 1 displaystyle F n 1 or Fn 2 displaystyle F n 2 giving a total of Fn 1 Fn 2 displaystyle F n 1 F n 2 sequences showing this is equal to Fn displaystyle F n In a similar manner it may be shown that the sum of the first Fibonacci numbers up to the n th is equal to the n 2 th Fibonacci number minus 1 In symbols i 1nFi Fn 2 1 displaystyle sum i 1 n F i F n 2 1 This may be seen by dividing all sequences summing to n 1 displaystyle n 1 based on the location of the first 2 Specifically each set consists of those sequences that start 2 1 2 displaystyle 2 1 2 until the last two sets 1 1 1 2 1 1 1 displaystyle 1 1 1 2 1 1 1 each with cardinality 1 Following the same logic as before by summing the cardinality of each set we see that Fn 2 Fn Fn 1 1 1 1 2 1 1 1 displaystyle F n 2 F n F n 1 1 1 1 2 1 1 1 where the last two terms have the value F1 1 displaystyle F 1 1 From this it follows that i 1nFi Fn 2 1 displaystyle sum i 1 n F i F n 2 1 A similar argument grouping the sums by the position of the first 1 rather than the first 2 gives two more identities i 0n 1F2i 1 F2n displaystyle sum i 0 n 1 F 2i 1 F 2n and i 1nF2i F2n 1 1 displaystyle sum i 1 n F 2i F 2n 1 1 In words the sum of the first Fibonacci numbers with odd index up to F2n 1 displaystyle F 2n 1 is the 2n th Fibonacci number and the sum of the first Fibonacci numbers with even index up to F2n displaystyle F 2n is the 2n 1 th Fibonacci number minus 1 A different trick may be used to prove i 1nFi2 FnFn 1 displaystyle sum i 1 n F i 2 F n F n 1 or in words the sum of the squares of the first Fibonacci numbers up to Fn displaystyle F n is the product of the n th and n 1 th Fibonacci numbers To see this begin with a Fibonacci rectangle of size Fn Fn 1 displaystyle F n times F n 1 and decompose it into squares of size Fn Fn 1 F1 displaystyle F n F n 1 F 1 from this the identity follows by comparing areas Symbolic method The sequence Fn n N displaystyle F n n in mathbb N is also considered using the symbolic method More precisely this sequence corresponds to a specifiable combinatorial class The specification of this sequence is Seq Z Z2 displaystyle operatorname Seq mathcal Z Z 2 Indeed as stated above the n displaystyle n th Fibonacci number equals the number of combinatorial compositions ordered partitions of n 1 displaystyle n 1 using terms 1 and 2 It follows that the ordinary generating function of the Fibonacci sequence i 0 Fizi displaystyle sum i 0 infty F i z i is the rational function z1 z z2 displaystyle frac z 1 z z 2 Induction proofs Fibonacci identities often can be easily proved using mathematical induction For example reconsider i 1nFi Fn 2 1 displaystyle sum i 1 n F i F n 2 1 Adding Fn 1 displaystyle F n 1 to both sides gives i 1nFi Fn 1 Fn 1 Fn 2 1 displaystyle sum i 1 n F i F n 1 F n 1 F n 2 1 and so we have the formula for n 1 displaystyle n 1 i 1n 1Fi Fn 3 1 displaystyle sum i 1 n 1 F i F n 3 1 Similarly add Fn 12 displaystyle F n 1 2 to both sides of i 1nFi2 FnFn 1 displaystyle sum i 1 n F i 2 F n F n 1 to give i 1nFi2 Fn 12 Fn 1 Fn Fn 1 displaystyle sum i 1 n F i 2 F n 1 2 F n 1 left F n F n 1 right i 1n 1Fi2 Fn 1Fn 2 displaystyle sum i 1 n 1 F i 2 F n 1 F n 2 Binet formula proofs The Binet formula is 5Fn fn psn displaystyle sqrt 5 F n varphi n psi n This can be used to prove Fibonacci identities For example to prove that i 1nFi Fn 2 1 textstyle sum i 1 n F i F n 2 1 note that the left hand side multiplied by 5 displaystyle sqrt 5 becomes 1 f f2 fn 1 ps ps2 psn fn 1 1f 1 psn 1 1ps 1 fn 1 1 ps psn 1 1 f fn 2 f psn 2 psfps fn 2 psn 2 f ps 5 Fn 2 1 displaystyle begin aligned 1 amp varphi varphi 2 dots varphi n left 1 psi psi 2 dots psi n right amp frac varphi n 1 1 varphi 1 frac psi n 1 1 psi 1 amp frac varphi n 1 1 psi frac psi n 1 1 varphi amp frac varphi n 2 varphi psi n 2 psi varphi psi amp varphi n 2 psi n 2 varphi psi amp sqrt 5 F n 2 1 end aligned as required using the facts fps 1 textstyle varphi psi 1 and f ps 5 textstyle varphi psi sqrt 5 to simplify the equations Other identitiesNumerous other identities can be derived using various methods Here are some of them Cassini s and Catalan s identities Cassini s identity states that Fn2 Fn 1Fn 1 1 n 1 displaystyle F n 2 F n 1 F n 1 1 n 1 Catalan s identity is a generalization Fn2 Fn rFn r 1 n rFr2 displaystyle F n 2 F n r F n r 1 n r F r 2 d Ocagne s identity FmFn 1 Fm 1Fn 1 nFm n displaystyle F m F n 1 F m 1 F n 1 n F m n F2n Fn 12 Fn 12 Fn Fn 1 Fn 1 FnLn displaystyle F 2n F n 1 2 F n 1 2 F n left F n 1 F n 1 right F n L n where Ln is the n th Lucas number The last is an identity for doubling n other identities of this type are F3n 2Fn3 3FnFn 1Fn 1 5Fn3 3 1 nFn displaystyle F 3n 2 F n 3 3F n F n 1 F n 1 5 F n 3 3 1 n F n by Cassini s identity F3n 1 Fn 13 3Fn 1Fn2 Fn3 displaystyle F 3n 1 F n 1 3 3F n 1 F n 2 F n 3 F3n 2 Fn 13 3Fn 12Fn Fn3 displaystyle F 3n 2 F n 1 3 3 F n 1 2 F n F n 3 F4n 4FnFn 1 Fn 12 2Fn2 3Fn2 Fn2 2Fn 12 displaystyle F 4n 4F n F n 1 left F n 1 2 2 F n 2 right 3 F n 2 left F n 2 2 F n 1 2 right These can be found experimentally using lattice reduction and are useful in setting up the special number field sieve to factorize a Fibonacci number More generally Fkn c i 0k ki Fc iFniFn 1k i displaystyle F kn c sum i 0 k k choose i F c i F n i F n 1 k i or alternatively Fkn c i 0k ki Fc iFniFn 1k i displaystyle F kn c sum i 0 k k choose i F c i F n i F n 1 k i Putting k 2 in this formula one gets again the formulas of the end of above section Matrix form Generating functionThe generating function of the Fibonacci sequence is the power series s z k 0 Fkzk 0 z z2 2z3 3z4 5z5 displaystyle s z sum k 0 infty F k z k 0 z z 2 2z 3 3z 4 5z 5 dots This series is convergent for any complex number z displaystyle z satisfying z lt 1 f 0 618 displaystyle z lt 1 varphi approx 0 618 and its sum has a simple closed form s z z1 z z2 displaystyle s z frac z 1 z z 2 This can be proved by multiplying by 1 z z2 textstyle 1 z z 2 1 z z2 s z k 0 Fkzk k 0 Fkzk 1 k 0 Fkzk 2 k 0 Fkzk k 1 Fk 1zk k 2 Fk 2zk 0z0 1z1 0z1 k 2 Fk Fk 1 Fk 2 zk z displaystyle begin aligned 1 z z 2 s z amp sum k 0 infty F k z k sum k 0 infty F k z k 1 sum k 0 infty F k z k 2 amp sum k 0 infty F k z k sum k 1 infty F k 1 z k sum k 2 infty F k 2 z k amp 0z 0 1z 1 0z 1 sum k 2 infty F k F k 1 F k 2 z k amp z end aligned where all terms involving zk displaystyle z k for k 2 displaystyle k geq 2 cancel out because of the defining Fibonacci recurrence relation The partial fraction decomposition is given by s z 15 11 fz 11 psz displaystyle s z frac 1 sqrt 5 left frac 1 1 varphi z frac 1 1 psi z right where f 12 1 5 textstyle varphi tfrac 1 2 left 1 sqrt 5 right is the golden ratio and ps 12 1 5 displaystyle psi tfrac 1 2 left 1 sqrt 5 right is its conjugate The related function z s 1 z textstyle z mapsto s left 1 z right is the generating function for the negafibonacci numbers and s z displaystyle s z satisfies the functional equation s z s 1z displaystyle s z s left frac 1 z right Using z displaystyle z equal to any of 0 01 0 001 0 0001 etc lays out the first Fibonacci numbers in the decimal expansion of s z displaystyle s z For example s 0 001 0 0010 998999 1000998999 0 001001002003005008013021 displaystyle s 0 001 frac 0 001 0 998999 frac 1000 998999 0 001001002003005008013021 ldots Reciprocal sumsInfinite sums over reciprocal Fibonacci numbers can sometimes be evaluated in terms of theta functions For example the sum of every odd indexed reciprocal Fibonacci number can be written as k 1 1F2k 1 54ϑ2 0 3 52 2 displaystyle sum k 1 infty frac 1 F 2k 1 frac sqrt 5 4 vartheta 2 left 0 frac 3 sqrt 5 2 right 2 and the sum of squared reciprocal Fibonacci numbers as k 1 1Fk2 524 ϑ2 0 3 52 4 ϑ4 0 3 52 4 1 displaystyle sum k 1 infty frac 1 F k 2 frac 5 24 left vartheta 2 left 0 frac 3 sqrt 5 2 right 4 vartheta 4 left 0 frac 3 sqrt 5 2 right 4 1 right If we add 1 to each Fibonacci number in the first sum there is also the closed form k 1 11 F2k 1 52 displaystyle sum k 1 infty frac 1 1 F 2k 1 frac sqrt 5 2 and there is a nested sum of squared Fibonacci numbers giving the reciprocal of the golden ratio k 1 1 k 1 j 1kFj2 5 12 displaystyle sum k 1 infty frac 1 k 1 sum j 1 k F j 2 frac sqrt 5 1 2 The sum of all even indexed reciprocal Fibonacci numbers is k 1 1F2k 5 L ps2 L ps4 displaystyle sum k 1 infty frac 1 F 2k sqrt 5 left L psi 2 L psi 4 right with the Lambert series L q k 1 qk1 qk displaystyle textstyle L q sum k 1 infty frac q k 1 q k since 1F2k 5 ps2k1 ps2k ps4k1 ps4k displaystyle textstyle frac 1 F 2k sqrt 5 left frac psi 2k 1 psi 2k frac psi 4k 1 psi 4k right So the reciprocal Fibonacci constant is k 1 1Fk k 1 1F2k 1 k 1 1F2k 3 359885666243 displaystyle sum k 1 infty frac 1 F k sum k 1 infty frac 1 F 2k 1 sum k 1 infty frac 1 F 2k 3 359885666243 dots Moreover this number has been proved irrational by Millin s series gives the identity k 0 1F2k 7 52 displaystyle sum k 0 infty frac 1 F 2 k frac 7 sqrt 5 2 which follows from the closed form for its partial sums as N tends to infinity k 0N1F2k 3 F2N 1F2N displaystyle sum k 0 N frac 1 F 2 k 3 frac F 2 N 1 F 2 N Primes and divisibilityDivisibility properties Every third number of the sequence is even a multiple of F3 2 displaystyle F 3 2 and more generally every k th number of the sequence is a multiple of Fk Thus the Fibonacci sequence is an example of a divisibility sequence In fact the Fibonacci sequence satisfies the stronger divisibility propertygcd Fa Fb Fc Fgcd a b c displaystyle gcd F a F b F c ldots F gcd a b c ldots where gcd is the greatest common divisor function This relation is different if a different indexing convention is used such as the one that starts the sequence with F0 1 displaystyle F 0 1 and F1 1 displaystyle F 1 1 In particular any three consecutive Fibonacci numbers are pairwise coprime because both F1 1 displaystyle F 1 1 and F2 1 displaystyle F 2 1 That is gcd Fn Fn 1 gcd Fn Fn 2 gcd Fn 1 Fn 2 1 displaystyle gcd F n F n 1 gcd F n F n 2 gcd F n 1 F n 2 1 for every n Every prime number p divides a Fibonacci number that can be determined by the value of p modulo 5 If p is congruent to 1 or 4 modulo 5 then p divides Fp 1 and if p is congruent to 2 or 3 modulo 5 then p divides Fp 1 The remaining case is that p 5 and in this case p divides Fp p 5 p Fp p 1 mod5 p Fp 1 p 2 mod5 p Fp 1 displaystyle begin cases p 5 amp Rightarrow p mid F p p equiv pm 1 pmod 5 amp Rightarrow p mid F p 1 p equiv pm 2 pmod 5 amp Rightarrow p mid F p 1 end cases These cases can be combined into a single non piecewise formula using the Legendre symbol p Fp 5p displaystyle p mid F p left frac 5 p right Primality testing The above formula can be used as a primality test in the sense that if n Fn 5n displaystyle n mid F n left frac 5 n right where the Legendre symbol has been replaced by the Jacobi symbol then this is evidence that n is a prime and if it fails to hold then n is definitely not a prime If n is composite and satisfies the formula then n is a Fibonacci pseudoprime When m is large say a 500 bit number then we can calculate Fm mod n efficiently using the matrix form Thus Fm 1FmFmFm 1 1110 m modn displaystyle begin pmatrix F m 1 amp F m F m amp F m 1 end pmatrix equiv begin pmatrix 1 amp 1 1 amp 0 end pmatrix m pmod n Here the matrix power Am is calculated using modular exponentiation which can be adapted to matrices Fibonacci primes A Fibonacci prime is a Fibonacci number that is prime The first few are 2 3 5 13 89 233 1597 28657 514229 Fibonacci primes with thousands of digits have been found but it is not known whether there are infinitely many Fkn is divisible by Fn so apart from F4 3 any Fibonacci prime must have a prime index As there are arbitrarily long runs of composite numbers there are therefore also arbitrarily long runs of composite Fibonacci numbers No Fibonacci number greater than F6 8 is one greater or one less than a prime number The only nontrivial square Fibonacci number is 144 Attila Petho proved in 2001 that there is only a finite number of perfect power Fibonacci numbers In 2006 Y Bugeaud M Mignotte and S Siksek proved that 8 and 144 are the only such non trivial perfect powers 1 3 21 and 55 are the only triangular Fibonacci numbers which was conjectured by Vern Hoggatt and proved by Luo Ming No Fibonacci number can be a perfect number More generally no Fibonacci number other than 1 can be multiply perfect and no ratio of two Fibonacci numbers can be perfect Prime divisors With the exceptions of 1 8 and 144 F1 F2 F6 and F12 every Fibonacci number has a prime factor that is not a factor of any smaller Fibonacci number Carmichael s theorem As a result 8 and 144 F6 and F12 are the only Fibonacci numbers that are the product of other Fibonacci numbers The divisibility of Fibonacci numbers by a prime p is related to the Legendre symbol p5 displaystyle bigl tfrac p 5 bigr which is evaluated as follows p5 0if p 51if p 1 mod5 1if p 2 mod5 displaystyle left frac p 5 right begin cases 0 amp text if p 5 1 amp text if p equiv pm 1 pmod 5 1 amp text if p equiv pm 2 pmod 5 end cases If p is a prime number then Fp p5 modp andFp p5 0 modp displaystyle F p equiv left frac p 5 right pmod p quad text and quad F p left frac p 5 right equiv 0 pmod p For example 25 1 F3 2 F2 1 35 1 F4 3 F3 2 55 0 F5 5 75 1 F8 21 F7 13 115 1 F10 55 F11 89 displaystyle begin aligned bigl tfrac 2 5 bigr amp 1 amp F 3 amp 2 amp F 2 amp 1 bigl tfrac 3 5 bigr amp 1 amp F 4 amp 3 amp F 3 amp 2 bigl tfrac 5 5 bigr amp 0 amp F 5 amp 5 bigl tfrac 7 5 bigr amp 1 amp F 8 amp 21 amp F 7 amp 13 bigl tfrac 11 5 bigr amp 1 amp F 10 amp 55 amp F 11 amp 89 end aligned It is not known whether there exists a prime p such that Fp p5 0 modp2 displaystyle F p left frac p 5 right equiv 0 pmod p 2 Such primes if there are any would be called Wall Sun Sun primes Also if p 5 is an odd prime number then 5Fp 122 12 5 p5 5 modp if p 1 mod4 12 5 p5 3 modp if p 3 mod4 displaystyle 5 F frac p pm 1 2 2 equiv begin cases tfrac 1 2 left 5 bigl tfrac p 5 bigr pm 5 right pmod p amp text if p equiv 1 pmod 4 tfrac 1 2 left 5 bigl tfrac p 5 bigr mp 3 right pmod p amp text if p equiv 3 pmod 4 end cases Example 1 p 7 in this case p 3 mod 4 and we have 75 1 12 5 75 3 1 12 5 75 3 4 displaystyle bigl tfrac 7 5 bigr 1 qquad tfrac 1 2 left 5 bigl tfrac 7 5 bigr 3 right 1 quad tfrac 1 2 left 5 bigl tfrac 7 5 bigr 3 right 4 F3 2 and F4 3 displaystyle F 3 2 text and F 4 3 5F32 20 1 mod7 and 5F42 45 4 mod7 displaystyle 5 F 3 2 20 equiv 1 pmod 7 text and 5 F 4 2 45 equiv 4 pmod 7 Example 2 p 11 in this case p 3 mod 4 and we have 115 1 12 5 115 3 4 12 5 115 3 1 displaystyle bigl tfrac 11 5 bigr 1 qquad tfrac 1 2 left 5 bigl tfrac 11 5 bigr 3 right 4 quad tfrac 1 2 left 5 bigl tfrac 11 5 bigr 3 right 1 F5 5 and F6 8 displaystyle F 5 5 text and F 6 8 5F52 125 4 mod11 and 5F62 320 1 mod11 displaystyle 5 F 5 2 125 equiv 4 pmod 11 text and 5 F 6 2 320 equiv 1 pmod 11 Example 3 p 13 in this case p 1 mod 4 and we have 135 1 12 5 135 5 5 12 5 135 5 0 displaystyle bigl tfrac 13 5 bigr 1 qquad tfrac 1 2 left 5 bigl tfrac 13 5 bigr 5 right 5 quad tfrac 1 2 left 5 bigl tfrac 13 5 bigr 5 right 0 F6 8 and F7 13 displaystyle F 6 8 text and F 7 13 5F62 320 5 mod13 and 5F72 845 0 mod13 displaystyle 5 F 6 2 320 equiv 5 pmod 13 text and 5 F 7 2 845 equiv 0 pmod 13 Example 4 p 29 in this case p 1 mod 4 and we have 295 1 12 5 295 5 0 12 5 295 5 5 displaystyle bigl tfrac 29 5 bigr 1 qquad tfrac 1 2 left 5 bigl tfrac 29 5 bigr 5 right 0 quad tfrac 1 2 left 5 bigl tfrac 29 5 bigr 5 right 5