In mathematics, the '''Fibonacci sequence''' is a [[Integer sequence|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 {{nowrap|{{math|''F<sub>n</sub>''}}{{space|hair}}}}. Many writers begin the sequence with 0 and 1, although some authors start it from 1 and 1<ref>Richard A. Brualdi, ''Introductory Combinatorics'', Fifth edition, Pearson, 2005</ref><ref>Peter Cameron, ''Combinatorics: Topics, Techniques, Algorithms'', Cambridge University Press, 1994</ref> and some (as did Fibonacci) from 1 and 2. Starting from 0 and 1, the sequence begins
In mathematics, the '''Fibonacci sequence''' is a [[Integer sequence|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 {{nowrap|{{math|''F<sub>n</sub>''}}{{space|hair}}}}. Many writers begin the sequence with 0 and 1, although some authors start it from 1 and 1<ref>Richard A. Brualdi, ''Introductory Combinatorics'', Fifth edition, Pearson, 2005</ref><ref>Peter Cameron, ''Combinatorics: Topics, Techniques, Algorithms'', Cambridge University Press, 1994</ref> and some (as did [[Fibonacci]]) from 1 and 2. Starting from 0 and 1, the sequence begins
The Fibonacci sequence can be extended to negative integer indices by following the same recurrence relation in the negative direction {{OEIS|A039834}}: {{tmath|1= F_1=1}}, {{tmath|1= F_0= 0}}, and {{tmath|1= F_{n}=F_{n+2} - F_{n+1} }} for {{math|''n'' < 0 }}. Nearly all properties of Fibonacci numbers do not depend upon whether the indices are positive or negative. The values for positive and negative indices obey the relation:<ref>{{cite book
| last = Vajda | first = Steven | author-link = Steven Vajda
| year = 1989
| title = Fibonacci & Lucas Numbers, and the Golden Section: Theory and Applications
The Fibonacci sequence appears in [[Indian mathematics]], in connection with [[Sanskrit prosody]].<ref name="HistoriaMathematica">{{Citation|first=Parmanand|last=Singh|title= The So-called Fibonacci numbers in ancient and medieval India|journal=Historia Mathematica|volume=12|issue=3|pages=229–244|year=1985|doi = 10.1016/0315-0860(85)90021-7|doi-access=free}}</ref><ref name="knuth-v1">{{Citation|title=The Art of Computer Programming|volume=1|first=Donald|last=Knuth| author-link =Donald Knuth |publisher=Addison Wesley|year=1968|isbn=978-81-7758-754-8|url=https://books.google.com/books?id=MooMkK6ERuYC&pg=PA100|page=100|quote=Before Fibonacci wrote his work, the sequence Fn had already been discussed by Indian scholars, who had long been interested in rhythmic patterns ... both Gopala (before 1135 AD) and Hemachandra (c. 1150) mentioned the numbers 1,2,3,5,8,13,21 explicitly [see P. Singh Historia Math 12 (1985) 229–44]" p. 100 (3d ed) ...}}</ref>{{sfn|Livio|2003|p=197}} 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 {{mvar|m}} units is {{math|''F''<sub>''m''+1</sub>}}.<ref name="Donald Knuth 2006 50">{{Citation|title = The Art of Computer Programming | volume = 4. Generating All Trees – History of Combinatorial Generation | first = Donald | last = Knuth | author-link = Donald Knuth |publisher= Addison–Wesley |year= 2006 | isbn= 978-0-321-33570-8 | page = 50 | url= https://books.google.com/books?id=56LNfE2QGtYC&q=rhythms&pg=PA50 | quote = it was natural to consider the set of all sequences of [L] and [S] that have exactly m beats. ... there are exactly Fm+1 of them. For example the 21 sequences when {{math|1=''m'' = 7}} are: [gives list]. In this way Indian prosodists were led to discover the Fibonacci sequence, as we have observed in Section 1.2.8 (from v.1)}}</ref>
The Fibonacci sequence appears in [[Indian mathematics]], in connection with [[Sanskrit prosody]].<ref name="HistoriaMathematica">{{Citation|first=Parmanand|last=Singh|title= The So-called Fibonacci numbers in ancient and medieval India|journal=Historia Mathematica|volume=12|issue=3|pages=229–244|year=1985|doi = 10.1016/0315-0860(85)90021-7|doi-access=free}}</ref><ref name="knuth-v1">{{Citation|title=The Art of Computer Programming|volume=1|first=Donald|last=Knuth| author-link =Donald Knuth |publisher=Addison Wesley|year=1968|isbn=978-81-7758-754-8|url=https://books.google.com/books?id=MooMkK6ERuYC&pg=PA100|page=100|quote=Before Fibonacci wrote his work, the sequence Fn had already been discussed by Indian scholars, who had long been interested in rhythmic patterns ... both Gopala (before 1135 AD) and Hemachandra (c. 1150) mentioned the numbers 1,2,3,5,8,13,21 explicitly [see P. Singh Historia Math 12 (1985) 229–44]" p. 100 (3d ed) ...}}</ref>{{sfn|Livio|2003|p=197}} 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 {{mvar|m}} units is {{math|''F''<sub>''m''+1</sub>}}.<ref name="Donald Knuth 2006 50">{{Citation|title = The Art of Computer Programming | volume = 4. Generating All Trees – History of Combinatorial Generation | first = Donald | last = Knuth | author-link = Donald Knuth |publisher= Addison–Wesley |year= 2006 | isbn= 978-0-321-33570-8 | page = 50 | url= https://books.google.com/books?id=56LNfE2QGtYC&q=rhythms&pg=PA50 | quote = it was natural to consider the set of all sequences of [L] and [S] that have exactly m beats. ... there are exactly Fm+1 of them. For example the 21 sequences when {{math|1=''m'' = 7}} are: [gives list]. In this way Indian prosodists were led to discover the Fibonacci sequence, as we have observed in Section 1.2.8 (from v.1)}}</ref>
Knowledge of the Fibonacci sequence was expressed as early as [[Pingala]] ({{circa}} 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 {{mvar|m}} beats ({{math|''F''<sub>''m''+1</sub>}}) is obtained by adding one [S] to the {{math|''F''<sub>''m''</sub>}} cases and one [L] to the {{math|''F''<sub>''m''−1</sub>}} cases.<ref>{{Citation | last = Agrawala | first = VS | year = 1969 | title = ''Pāṇinikālīna Bhāratavarṣa'' (Hn.). Varanasi-I: TheChowkhamba Vidyabhawan | quote = SadgurushiShya writes that Pingala was a younger brother of Pāṇini [Agrawala 1969, lb]. There is an alternative opinion that he was a maternal uncle of Pāṇini [Vinayasagar 1965, Preface, 121]. ... Agrawala [1969, 463–76], after a careful investigation, in which he considered the views of earlier scholars, has concluded that Pāṇini lived between 480 and 410 BC}}</ref> [[Bharata Muni]] also expresses knowledge of the sequence in the ''[[Natya Shastra]]'' (c. 100 BC–c. 350 AD).<ref name=GlobalScience>{{Citation|title=Toward a Global Science|first=Susantha|last=Goonatilake|author-link=Susantha Goonatilake|publisher=Indiana University Press|year=1998|page=126|isbn=978-0-253-33388-9|url=https://books.google.com/books?id=SI5ip95BbgEC&pg=PA126}}</ref><ref name="HistoriaMathematica"/>
Knowledge of the Fibonacci sequence was expressed as early as [[Pingala]] ({{circa}} 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 {{mvar|m}} beats ({{math|''F''<sub>''m''+1</sub>}}) is obtained by adding one [S] to the {{math|''F''<sub>''m''</sub>}} cases and one [L] to the {{math|''F''<sub>''m''−1</sub>}} cases.<ref>{{Citation | last = Agrawala | first = VS | year = 1969 | title = ''Pāṇinikālīna Bhāratavarṣa'' (Hn.). Varanasi-I: TheChowkhamba Vidyabhawan | quote = SadgurushiShya writes that Pingala was a younger brother of Pāṇini [Agrawala 1969, lb]. There is an alternative opinion that he was a maternal uncle of Pāṇini [Vinayasagar 1965, Preface, 121]. ... Agrawala [1969, 463–76], after a careful investigation, in which he considered the views of earlier scholars, has concluded that Pāṇini lived between 480 and 410 BC}}</ref> [[Bharata Muni]] also expresses knowledge of the sequence in the ''[[Natya Shastra]]'' ({{Circa}} 100 BC–{{Circa}} 350 AD).<ref name=GlobalScience>{{Citation|title=Toward a Global Science|first=Susantha|last=Goonatilake|author-link=Susantha Goonatilake|publisher=Indiana University Press|year=1998|page=126|isbn=978-0-253-33388-9|url=https://books.google.com/books?id=SI5ip95BbgEC&pg=PA126}}</ref><ref name="HistoriaMathematica"/>
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):{{sfn|Livio|2003|p=197}}
However, the clearest exposition of the sequence arises in the work of [[Virahanka]] ({{Circa}} 700 AD), whose own work is lost, but is available in a quotation by Gopala ({{Circa}} 1135):{{sfn|Livio|2003|p=197}}
<blockquote>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].{{efn|"For four, variations of meters of two [and] three being mixed, five happens. For five, variations of two earlier—three [and] four, being mixed, eight is obtained. In this way, for six, [variations] of four [and] of five being mixed, thirteen happens. And like that, variations of two earlier meters being mixed, seven [[Mora (linguistics)|morae]] [is] twenty-one. In this way, the process should be followed in all mātrā-vṛttas" <ref>{{Citation|last=Velankar|first=HD|year=1962|title='Vṛttajātisamuccaya' of kavi Virahanka|publisher=Rajasthan Oriental Research Institute|location=Jodhpur|page=101}}</ref>}}</blockquote>
<blockquote>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].{{efn|"For four, variations of meters of two [and] three being mixed, five happens. For five, variations of two earlier—three [and] four, being mixed, eight is obtained. In this way, for six, [variations] of four [and] of five being mixed, thirteen happens. And like that, variations of two earlier meters being mixed, seven [[Mora (linguistics)|morae]] [is] twenty-one. In this way, the process should be followed in all mātrā-vṛttas" <ref>{{Citation|last=Velankar|first=HD|year=1962|title='Vṛttajātisamuccaya' of kavi Virahanka|publisher=Rajasthan Oriental Research Institute|location=Jodhpur|page=101}}</ref>}}</blockquote>
[[Hemachandra]] (c. 1150) is credited with knowledge of the sequence as well,<ref name=GlobalScience/> writing that "the sum of the last and the one before the last is the number ... of the next mātrā-vṛtta."{{sfn|Livio|2003|p=197–198}}<ref>{{citation|last1=Shah|first1=Jayant|year=1991|title=A History of Piṅgala's Combinatorics|url=https://web.northeastern.edu/shah/papers/Pingala.pdf|publisher=[[Northeastern University]]|page=41|access-date=2019-01-04}}</ref>
[[Hemachandra]] ({{Circa}} 1150) is credited with knowledge of the sequence as well,<ref name=GlobalScience/> writing that "the sum of the last and the one before the last is the number ... of the next mātrā-vṛtta."{{sfn|Livio|2003|p=197–198}}<ref>{{citation|last1=Shah|first1=Jayant|year=1991|title=A History of Piṅgala's Combinatorics|url=https://web.northeastern.edu/shah/papers/Pingala.pdf|publisher=[[Northeastern University]]|page=41|access-date=2019-01-04}}</ref>
The numbers {{tmath|\varphi}} and {{tmath|\psi}} are the two solutions of the [[quadratic equation]] {{tmath|1=\textstyle x^2 - x - 1 = 0}}, that is, {{tmath|1= (x - \varphi)(x - \psi) = x^2 - x - 1}}, and thus they satisfy the identities {{tmath|1= \varphi + \psi = 1}} and {{tmath|1= \varphi\psi = -1}}.
is the [[golden ratio]], and <math>\psi</math> is its [[Conjugate (square roots)|conjugate]]:{{Sfn | Ball | 2003 | p = 156}}
Since <math>\psi = -\varphi^{-1}</math>, Binet's formula can also be written as
Since <math>\psi = -\varphi^{-1}</math>, this formula can also be written as
<math display=block>
<math display=block>
Line 138:
Line 145:
</math>
</math>
To see the relation between the sequence and these constants,{{Sfn | Ball | 2003 | pp = 155–156}} note that <math>\varphi</math> and <math>\psi</math> are both solutions of the equation <math display=inline>x^2 = x + 1</math> and thus <math>x^n = x^{n-1} + x^{n-2},</math> so the powers of <math>\varphi</math> and <math>\psi</math> satisfy the Fibonacci recursion. In other words,
To see the relation between the sequence and these constants,{{Sfn | Ball | 2003 | pp = 155–156}} note that <math>\varphi</math> and <math>\psi</math> are also roots of <math>x^n = x^{n-1} + x^{n-2},</math> so the powers of <math>\varphi</math> and <math>\psi</math> satisfy the Fibonacci recurrence. In other words,
<math display=block>\begin{align}
<math display=block>\begin{align}
Line 149:
Line 156:
<math display=block>U_n=a \varphi^n + b \psi^n</math>
<math display=block>U_n=a \varphi^n + b \psi^n</math>
satisfies the same recurrence,
satisfies the same recurrence. If {{mvar|a}} and {{mvar|b}} are chosen so that {{math|1=''U''<sub>0</sub> = 0}} and {{math|1=''U''<sub>1</sub> = 1}} then the resulting sequence {{math|''U''<sub>''n''</sub>}} must be the Fibonacci sequence. This is the same as requiring {{mvar|a}} and {{mvar|b}} satisfy the system of equations:
If {{mvar|a}} and {{mvar|b}} are chosen so that {{math|1=''U''<sub>0</sub> = 0}} and {{math|1=''U''<sub>1</sub> = 1}} then the resulting sequence {{math|''U''<sub>''n''</sub>}} must be the Fibonacci sequence. This is the same as requiring {{mvar|a}} and {{mvar|b}} satisfy the system of equations:
<math display=block>
<math display=block>
\left\{\begin{align} a + b &= 0 \\ \varphi a + \psi b &= 1\end{align}\right.
\begin{align} a \varphi^0 + b \psi^0 &= 0 \\ a \varphi^1 + b \psi^1 &= 1\end{align}
</math>
</math>
Line 172:
Line 170:
producing the required formula.
producing the required formula.
Taking the starting values {{math|''U''<sub>0</sub>}} and {{math|''U''<sub>1</sub>}} to be arbitrary constants, a more general solution is:
Taking the starting values {{math|''U''<sub>0</sub>}} and {{math|''U''<sub>1</sub>}} to be arbitrary constants and solving the system of equations gives the general solution
In particular, choosing {{math|1=''a'' = 1}} makes the {{mvar|n}}-th element of the sequence closely approximate the {{mvar|n}}-th power of {{tmath|\varphi}} for large enough values of {{mvar|n}}. This arises when {{math|1=''U''{{sub|0}} = 2}} and {{math|1=''U''{{sub|1}} = 1}}, which produces the sequence of [[Lucas number]]s.
=== Computation by rounding ===
=== Computation by rounding ===
Line 201:
Line 195:
=== Limit of consecutive quotients ===
=== Limit of consecutive quotients ===
[[Johannes Kepler]] observed that the ratio of consecutive Fibonacci numbers [[convergent sequence|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 <math>\varphi\colon </math> <ref>{{Citation|last=Kepler |first=Johannes |title=A New Year Gift: On Hexagonal Snow |year=1966 |isbn=978-0-19-858120-8 |publisher=Oxford University Press |page= 92}}</ref><ref>{{Citation | title = Strena seu de Nive Sexangula | year = 1611}}</ref>
[[Johannes Kepler]] observed that the ratio of consecutive Fibonacci numbers [[convergent sequence|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 {{tmath|\varphi}}:<ref>{{Citation|last=Kepler |first=Johannes |title=A New Year Gift: On Hexagonal Snow |year=1966 |isbn=978-0-19-858120-8 |publisher=Oxford University Press |page= 92}}</ref><ref>{{Citation | title = Strena seu de Nive Sexangula | year = 1611}}</ref>
Binet's formula provides a proof that a positive integer {{mvar|x}} is a Fibonacci number [[if and only if]] at least one of <math>5x^2+4</math> or <math>5x^2-4</math> is a [[Square number|perfect square]].<ref>{{Citation | title = Fibonacci is a Square | last1 = Gessel | first1 = Ira | journal = [[The Fibonacci Quarterly]] | volume = 10 | issue = 4 | pages = 417–19 |date=October 1972 | url = https://www.fq.math.ca/Scanned/10-4/advanced10-4.pdf | access-date = 2012-04-11 }}</ref> This is because Binet's formula, which can be written as <math>F_n = (\varphi^n - (-1)^n \varphi^{-n}) / \sqrt{5}</math>, can be multiplied by <math>\sqrt{5} \varphi^n</math> and solved as a [[quadratic equation]] in <math>\varphi^n</math> via the [[quadratic formula]]:
Binet's formula provides a proof that a positive integer {{mvar|x}} is a Fibonacci number [[if and only if]] at least one of <math>5x^2+4</math> or <math>5x^2-4</math> is a [[Square number|perfect square]].<ref>{{Citation | title = Fibonacci is a Square | last1 = Gessel | first1 = Ira | journal = [[The Fibonacci Quarterly]] | volume = 10 | issue = 4 | pages = 417–19 |date=October 1972 | url = https://www.fq.math.ca/Scanned/10-4/advanced10-4.pdf | access-date = 2012-04-11 }}</ref> This is because Binet's formula, which can be written as <math>F_n = (\varphi^n - (-1)^n \varphi^{-n}) / \sqrt{5}</math>, can be multiplied by <math>\sqrt{5} \varphi^n</math> and solved as a [[quadratic equation]] in <math>\varphi^n</math> via the [[quadratic formula]]:
Equivalently, the same computation may be performed by [[Matrix diagonalization|diagonalization]] of {{math|'''A'''}} through use of its [[eigendecomposition]]:
Equivalently, the same computation may be performed by [[Matrix diagonalization|diagonalization]] of {{math|'''A'''}} through use of its [[eigendecomposition]]:
<math display=block>\begin{align}
<math display=block>\begin{align} A & = S\Lambda S^{-1}, \\[3mu]
The [[convergent (continued fraction)|convergents]] of the continued fraction for {{mvar|φ}} are ratios of successive Fibonacci numbers: {{math|1=''φ''<sub>''n''</sub> = ''F''<sub>''n''+1</sub> / ''F''<sub>''n''</sub>}} is the {{mvar|n}}-th convergent, and the {{math|(''n'' + 1)}}-st convergent can be found from the recurrence relation {{math|1=''φ''<sub>''n''+1</sub> = 1 + 1 / ''φ''<sub>''n''</sub>}}.<ref>{{Cite web |title=The Golden Ratio, Fibonacci Numbers and Continued Fractions. |url=https://nrich.maths.org/2737 |access-date=2024-03-22 |website=nrich.maths.org |language=en}}</ref> 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:
The [[convergent (continued fraction)|convergents]] of the continued fraction for {{mvar|φ}} are ratios of successive Fibonacci numbers: {{math|1=''φ''<sub>''n''</sub> = ''F''<sub>''n''+1</sub> / ''F''<sub>''n''</sub>}} is the {{mvar|n}}-th convergent, and the {{math|(''n'' + 1)}}-st convergent can be found from the recurrence relation {{math|1=''φ''<sub>''n''+1</sub> = 1 + 1 / ''φ''<sub>''n''</sub>}}.<ref>{{Cite web |title=The Golden Ratio, Fibonacci Numbers and Continued Fractions. |url=https://nrich.maths.org/2737 |access-date=2024-03-22 |website=nrich.maths.org |language=en}}</ref> 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 {{mvar|n}}, this matrix can be computed in {{math|''O''(log ''n'')}} arithmetic operations, using the [[exponentiation by squaring]] method.
</math>
For a given {{mvar|n}}, this matrix can be computed in {{math|''O''(log ''n'')}} arithmetic operations,{{efn|This counts [[arbitrary-precision arithmetic]] operations as being {{math|''O''(1)}}. If taking the bitlength into account, exponentiation by squaring is still a marked improvement, but overall complexity is dominated by the very last multiplication step; there are {{math|''O''(''n'')}} digits in the result, and the task requires producing all of them.}} using the [[exponentiation by squaring]] method.
Taking the determinant of both sides of this equation yields [[Cassini's identity]],
Taking the determinant of both sides of this equation yields [[Cassini's identity]],
The sequence <math>(F_n)_{n\in\mathbb N}</math> is also considered using the [[symbolic method (combinatorics)|symbolic method]].<ref>{{citation |last1=Flajolet |first1=Philippe |last2=Sedgewick |first2=Robert |title=Analytic Combinatorics|title-link= Analytic Combinatorics |date=2009 |publisher=Cambridge University Press |isbn=978-0521898065 |page=42}}</ref> More precisely, this sequence corresponds to a [[specifiable combinatorial class]]. The specification of this sequence is <math>\operatorname{Seq}(\mathcal{Z+Z^2})</math>. Indeed, as stated above, the <math>n</math>-th Fibonacci number equals the number of [[Composition (combinatorics)|combinatorial compositions]] (ordered [[integer partition|partitions]]) of <math>n-1</math> using terms 1 and 2.
It follows that the [[ordinary generating function]] of the Fibonacci sequence, <math>\sum_{i=0}^\infty F_iz^i</math>, is the [[rational function]] <math>\frac{z}{1-z-z^2}.</math>
where <math display=inline>\varphi = \tfrac12\left(1 + \sqrt{5}\right)</math> is the golden ratio and <math>\psi = \tfrac12\left(1 - \sqrt{5}\right)</math> is its [[Conjugate (square roots)|conjugate]].
where <math display=inline>\varphi = \tfrac12\left(1 + \sqrt{5}\right)</math> is the golden ratio and <math>\psi = \tfrac12\left(1 - \sqrt{5}\right)</math> is its [[Conjugate (square roots)|conjugate]].
The related function <math display=inline>z \mapsto -s\left(-1/z\right)</math> is the generating function for the [[negafibonacci]] numbers, and <math>s(z)</math> satisfies the [[functional equation]]
Using <math>z</math> equal to any of 0.01, 0.001, 0.0001, etc. lays out the first Fibonacci numbers in the decimal expansion of <math>s(z)</math>. For example, <math>s(0.001) = \frac{0.001}{0.998999} = \frac{1000}{998999} = 0.001001002003005008013021\ldots.</math>
Using <math>z</math> equal to any of 0.01, 0.001, 0.0001, etc. lays out the first Fibonacci numbers in the decimal expansion of <math>s(z)</math>. For example, <math>s(0.001) = \frac{0.001}{0.998999} = \frac{1000}{998999} = 0.001001002003005008013021\ldots.</math>
Line 531:
Line 520:
| hdl-access = free
| hdl-access = free
}}. Williams calls this property "well known".</ref>
}}. Williams calls this property "well known".</ref>
where the Legendre symbol has been replaced by the [[Jacobi symbol]], then this is evidence that {{mvar|n}} is a prime, and if it fails to hold, then {{mvar|n}} is definitely not a prime. If {{mvar|n}} is [[composite number|composite]] and satisfies the formula, then {{mvar|n}} is a ''Fibonacci pseudoprime''. When {{mvar|m}} is large{{snd}}say a 500-[[bit]] number{{snd}}then we can calculate {{math|''F''<sub>''m''</sub> (mod ''n'')}} efficiently using the matrix form. Thus
where the Legendre symbol has been replaced by the [[Jacobi symbol]], then this is evidence that {{mvar|n}} is a prime, and if it fails to hold, then {{mvar|n}} is definitely not a prime. If {{mvar|n}} is [[composite number|composite]] and satisfies the formula, then {{mvar|n}} is a ''Fibonacci pseudoprime''. When {{mvar|m}} is large{{snd}}say a 500-[[bit]] number{{snd}}then we can calculate {{math|''F''<sub>''m''</sub> (mod ''n'')}} efficiently using the matrix form. Thus
Line 603:
Line 592:
It is not known whether there exists a prime {{mvar|p}} such that
It is not known whether there exists a prime {{mvar|p}} such that
Such primes (if there are any) would be called [[Wall–Sun–Sun prime]]s.
Such primes (if there are any) would be called [[Wall–Sun–Sun prime]]s.
Line 715:
Line 704:
The Fibonacci numbers can be found in different ways among the set of [[binary numeral system|binary]] [[String (computer science)|strings]], or equivalently, among the [[subset]]s of a given set.
The Fibonacci numbers can be found in different ways among the set of [[binary numeral system|binary]] [[String (computer science)|strings]], or equivalently, among the [[subset]]s of a given set.
* The number of binary strings of length {{mvar|n}} without consecutive {{math|1}}s is the Fibonacci number {{math|''F''<sub>''n''+2</sub>}}. For example, out of the 16 binary strings of length 4, there are {{math|1=''F''<sub>6</sub> = 8}} without consecutive {{math|1}}s—they are 0000, 0001, 0010, 0100, 0101, 1000, 1001, and 1010. Such strings are the binary representations of [[Fibbinary number]]s. Equivalently, {{math|''F''<sub>''n''+2</sub>}} is the number of subsets {{mvar|S}} of {{math|{{mset|1, ..., ''n''}}}} without consecutive integers, that is, those {{mvar|S}} for which {{math|{{mset|''i'', ''i'' + 1}} ⊈ ''S''}} for every {{mvar|i}}. A [[bijection]] with the sums to {{math|''n''+1}} is to replace 1 with 0 and 2 with 10, and drop the last zero.
* The number of binary strings of length {{mvar|n}} without consecutive {{mono|1}}s is the Fibonacci number {{math|''F''<sub>''n''+2</sub>}}. For example, out of the 16 binary strings of length 4, there are {{math|1=''F''<sub>6</sub> = 8}} without consecutive {{math|1}}s—they are {{mono|0000}}, {{mono|0001}}, {{mono|0010}}, {{mono|0100}}, {{mono|0101}}, {{mono|1000}}, {{mono|1001}}, and {{mono|1010}}. Such strings are the binary representations of [[Fibbinary number]]s. Equivalently, {{math|''F''<sub>''n''+2</sub>}} is the number of subsets {{mvar|S}} of {{math|{{mset|1, ..., ''n''}}}} without consecutive integers, that is, those {{mvar|S}} for which {{math|{{mset|''i'', ''i'' + 1}} ⊈ ''S''}} for every {{mvar|i}}. A [[bijection]] with the sums to {{math|''n''+1}} is to replace 1 with {{mono|0}} and 2 with {{mono|10}}, and drop the last zero.
* The number of binary strings of length {{mvar|n}} without an odd number of consecutive {{math|1}}s is the Fibonacci number {{math|''F''<sub>''n''+1</sub>}}. For example, out of the 16 binary strings of length 4, there are {{math|1=''F''<sub>5</sub> = 5}} without an odd number of consecutive {{math|1}}s—they are 0000, 0011, 0110, 1100, 1111. Equivalently, the number of subsets {{mvar|S}} of {{math|{{mset|1, ..., ''n''}}}} without an odd number of consecutive integers is {{math|''F''<sub>''n''+1</sub>}}. A bijection with the sums to {{mvar|n}} is to replace 1 with 0 and 2 with 11.
* The number of binary strings of length {{mvar|n}} without an odd number of consecutive {{mono|1}}s is the Fibonacci number {{math|''F''<sub>''n''+1</sub>}}. For example, out of the 16 binary strings of length 4, there are {{math|1=''F''<sub>5</sub> = 5}} without an odd number of consecutive {{mono|1}}s—they are {{mono|0000}}, {{mono|0011}}, {{mono|0110}}, {{mono|1100}}, {{mono|1111}}. Equivalently, the number of subsets {{mvar|S}} of {{math|{{mset|1, ..., ''n''}}}} without an odd number of consecutive integers is {{math|''F''<sub>''n''+1</sub>}}. A bijection with the sums to {{mvar|n}} is to replace 1 with {{mono|0}} and 2 with {{mono|11}}.
* The number of binary strings of length {{mvar|n}} without an even number of consecutive {{math|0}}s or {{math|1}}s is {{math|2''F''<sub>''n''</sub>}}. For example, out of the 16 binary strings of length 4, there are {{math|1=2''F''<sub>4</sub> = 6}} without an even number of consecutive {{math|0}}s or {{math|1}}s—they are 0001, 0111, 0101, 1000, 1010, 1110. There is an equivalent statement about subsets.
* The number of binary strings of length {{mvar|n}} without an even number of consecutive {{mono|0}}s or {{mono|1}}s is {{math|2''F''<sub>''n''</sub>}}. For example, out of the 16 binary strings of length 4, there are {{math|1=2''F''<sub>4</sub> = 6}} without an even number of consecutive {{mono|0}}s or {{mono|1}}s—they are {{mono|0001}}, {{mono|0111}}, {{mono|0101}}, {{mono|1000}}, {{mono|1010}}, {{mono|1110}}. There is an equivalent statement about subsets.
* [[Yuri Matiyasevich]] was able to show that the Fibonacci numbers can be defined by a [[Diophantine equation]], which led to [[Matiyasevich's theorem|his solving]] [[Hilbert's tenth problem]].<ref>{{citation|title=Review of Yuri V. Matiyasevich, ''Hibert's Tenth Problem''|journal=Modern Logic|first=Valentina|last=Harizanov|author-link=Valentina Harizanov|volume=5|issue=3|year=1995|pages=345–55|url=https://projecteuclid.org/euclid.rml/1204900767}}</ref>
* [[Yuri Matiyasevich]] was able to show that the Fibonacci numbers can be defined by a [[Diophantine equation]], which led to [[Matiyasevich's theorem|his solving]] [[Hilbert's tenth problem]].<ref>{{citation|title=Review of Yuri V. Matiyasevich, ''Hibert's Tenth Problem''|journal=Modern Logic|first=Valentina|last=Harizanov|author-link=Valentina Harizanov|volume=5|issue=3|year=1995|pages=345–55|url=https://projecteuclid.org/euclid.rml/1204900767}}</ref>
* The Fibonacci numbers are also an example of a [[complete sequence]]. This means that every positive integer can be written as a sum of Fibonacci numbers, where any one number is used once at most.
* The Fibonacci numbers are also an example of a [[complete sequence]]. This means that every positive integer can be written as a sum of Fibonacci numbers, where any one number is used once at most.
Line 752:
Line 741:
[[File:FibonacciChamomile.PNG|thumb|[[Yellow chamomile]] head showing the arrangement in 21 (blue) and 13 (cyan) spirals. Such arrangements involving consecutive Fibonacci numbers appear in a wide variety of plants.]]
[[File:FibonacciChamomile.PNG|thumb|[[Yellow chamomile]] head showing the arrangement in 21 (blue) and 13 (cyan) spirals. Such arrangements involving consecutive Fibonacci numbers appear in a wide variety of plants.]]
Fibonacci sequences appear in biological settings,<ref>{{Citation |first1=S |last1=Douady |first2=Y |last2=Couder |title=Phyllotaxis as a Dynamical Self Organizing Process |journal=Journal of Theoretical Biology |year=1996 |issue=3 |pages=255–74 |url=http://www.math.ntnu.no/~jarlet/Douady96.pdf |doi=10.1006/jtbi.1996.0026 |volume=178 |url-status=dead |archive-url=https://web.archive.org/web/20060526054108/http://www.math.ntnu.no/~jarlet/Douady96.pdf |archive-date=2006-05-26 }}</ref> such as branching in trees, [[Phyllotaxis|arrangement of leaves on a stem]], the fruitlets of a [[pineapple]],<ref>{{Citation | first1=Judy |last1=Jones | first2=William | last2=Wilson |title=An Incomplete Education |publisher=Ballantine Books |year=2006 |isbn=978-0-7394-7582-9 |page=544 |chapter=Science}}</ref> the flowering of [[artichoke]], the arrangement of a [[pine cone]],<ref>{{Citation| first=A | last=Brousseau |title=Fibonacci Statistics in Conifers | journal=[[Fibonacci Quarterly]] |year=1969 |issue=7 |pages=525–32}}</ref> and the family tree of [[honeybee]]s.<ref>{{citation|url = https://www.cs4fn.org/maths/bee-davinci.php |work = Maths | publisher = Computer Science For Fun: CS4FN |title = Marks for the da Vinci Code: B–}}</ref><ref>{{Citation|first1=T.C.|last1=Scott|first2=P.|last2=Marketos| url = http://www-history.mcs.st-andrews.ac.uk/Publications/fibonacci.pdf | title = On the Origin of the Fibonacci Sequence | publisher = [[MacTutor History of Mathematics archive]], University of St Andrews| date = March 2014}}</ref> [[Kepler]] pointed out the presence of the Fibonacci sequence in nature, using it to explain the ([[golden ratio]]-related) [[pentagon]]al form of some flowers.{{sfn|Livio|2003|p=110}} Field [[Leucanthemum vulgare|daisies]] most often have petals in counts of Fibonacci numbers.{{sfn|Livio|2003|pp=112–13}} In 1830, [[Karl Friedrich Schimper]] and [[Alexander Braun]] discovered that the [[Parastichy|parastichies]] (spiral [[phyllotaxis]]) of plants were frequently expressed as fractions involving Fibonacci numbers.<ref>{{Citation |first =Franck |last = Varenne |title = Formaliser le vivant - Lois, Théories, Modèles | access-date = 2022-10-30| url = https://www.numilog.com/LIVRES/ISBN/9782705670894.Livre | page = 28 | date = 2010| isbn = 9782705678128|publisher = Hermann|quote = En 1830, K. F. Schimper et A. Braun [...]. Ils montraient que si l'on représente cet angle de divergence par une fraction reflétant le nombre de tours par feuille ([...]), on tombe régulièrement sur un des nombres de la suite de Fibonacci pour le numérateur [...].|language = fr}}</ref>
Fibonacci sequences appear in biological settings,<ref>{{Citation |first1=S |last1=Douady |first2=Y |last2=Couder |title=Phyllotaxis as a Dynamical Self Organizing Process |journal=Journal of Theoretical Biology |year=1996 |issue=3 |pages=255–74 |url=http://www.math.ntnu.no/~jarlet/Douady96.pdf |doi=10.1006/jtbi.1996.0026 |volume=178 |url-status=dead |archive-url=https://web.archive.org/web/20060526054108/http://www.math.ntnu.no/~jarlet/Douady96.pdf |archive-date=2006-05-26 }}</ref> such as branching in trees, [[Phyllotaxis|arrangement of leaves on a stem]], the fruitlets of a [[pineapple]],<ref>{{Citation | first1=Judy |last1=Jones | first2=William | last2=Wilson |title=An Incomplete Education |publisher=Ballantine Books |year=2006 |isbn=978-0-7394-7582-9 |page=544 |chapter=Science}}</ref> the flowering of [[artichoke]], the leaves of the spiral aloe<ref>{{Cite web |title=The Wonder of Fibonacci in our Gardens {{!}} UC Master Gardeners of San Mateo & San Francisco Counties |url=https://ucanr.edu/blog/uc-master-gardeners-san-mateo-san-francisco-counties/article/wonder-fibonacci-our-gardens |access-date=2025-11-18 |website=ucanr.edu |language=en}}</ref> (Aloe polyphylla), the arrangement of a [[pine cone]],<ref>{{Citation| first=A | last=Brousseau |title=Fibonacci Statistics in Conifers | journal=[[Fibonacci Quarterly]] |year=1969 |issue=7 |pages=525–32}}</ref> and the family tree of [[honeybee]]s.<ref>{{citation|url = https://www.cs4fn.org/maths/bee-davinci.php |work = Maths | publisher = Computer Science For Fun: CS4FN |title = Marks for the da Vinci Code: B–}}</ref><ref>{{Citation|first1=T.C.|last1=Scott|first2=P.|last2=Marketos| url = http://www-history.mcs.st-andrews.ac.uk/Publications/fibonacci.pdf | title = On the Origin of the Fibonacci Sequence | publisher = [[MacTutor History of Mathematics archive]], University of St Andrews| date = March 2014}}</ref> [[Kepler]] pointed out the presence of the Fibonacci sequence in nature, using it to explain the ([[golden ratio]]-related) [[pentagon]]al form of some flowers.{{sfn|Livio|2003|p=110}} Field [[Leucanthemum vulgare|daisies]] most often have petals in counts of Fibonacci numbers.{{sfn|Livio|2003|pp=112–13}} In 1830, [[Karl Friedrich Schimper]] and [[Alexander Braun]] discovered that the [[Parastichy|parastichies]] (spiral [[phyllotaxis]]) of plants were frequently expressed as fractions involving Fibonacci numbers.<ref>{{Citation |first =Franck |last = Varenne |title = Formaliser le vivant - Lois, Théories, Modèles | access-date = 2022-10-30| url = https://www.numilog.com/LIVRES/ISBN/9782705670894.Livre | page = 28 | date = 2010| isbn = 9782705678128|publisher = Hermann|quote = En 1830, K. F. Schimper et A. Braun [...]. Ils montraient que si l'on représente cet angle de divergence par une fraction reflétant le nombre de tours par feuille ([...]), on tombe régulièrement sur un des nombres de la suite de Fibonacci pour le numérateur [...].|language = fr}}</ref>
[[Przemysław Prusinkiewicz]] advanced the idea that real instances can in part be understood as the expression of certain algebraic constraints on [[free group]]s, specifically as certain [[L-system|Lindenmayer grammars]].<ref>{{Citation|first1 = Przemyslaw |last1 = Prusinkiewicz | first2 = James | last2 = Hanan| title = Lindenmayer Systems, Fractals, and Plants (Lecture Notes in Biomathematics) |publisher= [[Springer Science+Business Media|Springer-Verlag]] |year=1989 |isbn=978-0-387-97092-9}}</ref>
[[Przemysław Prusinkiewicz]] advanced the idea that real instances can in part be understood as the expression of certain algebraic constraints on [[free group]]s, specifically as certain [[L-system|Lindenmayer grammars]].<ref>{{Citation|first1 = Przemyslaw |last1 = Prusinkiewicz | first2 = James | last2 = Hanan| title = Lindenmayer Systems, Fractals, and Plants (Lecture Notes in Biomathematics) |publisher= [[Springer Science+Business Media|Springer-Verlag]] |year=1989 |isbn=978-0-387-97092-9}}</ref>
Line 790:
Line 779:
}}</ref>
}}</ref>
* Brasch et al. 2012 show how a generalized Fibonacci sequence also can be connected to the field of [[economics]].<ref name="Brasch et al. 2012">{{Citation| first1 =T. von | last1 = Brasch | first2 = J. | last2 = Byström | first3 = L.P. | last3 = Lystad| title= Optimal Control and the Fibonacci Sequence |journal = Journal of Optimization Theory and Applications |year=2012 |issue=3 |pages= 857–78 |doi = 10.1007/s10957-012-0061-2
* Brasch et al. 2012 show how a generalized Fibonacci sequence also can be connected to the field of [[economics]].<ref name="Brasch et al. 2012">{{Citation| first1 =T. von | last1 = Brasch | first2 = J. | last2 = Byström | first3 = L.P. | last3 = Lystad| title= Optimal Control and the Fibonacci Sequence |journal = Journal of Optimization Theory and Applications |year=2012 |issue=3 |pages= 857–78 |doi = 10.1007/s10957-012-0061-2
|volume=154 | hdl = 11250/180781 | s2cid = 8550726 | url = https://urn.kb.se/resolve?urn=urn:nbn:se:ltu:diva-24073 | hdl-access = free }}</ref> In particular, it is shown how a generalized Fibonacci sequence enters the control function of finite-horizon dynamic optimisation problems with one state and one control variable. The procedure is illustrated in an example often referred to as the Brock–Mirman economic growth model.
|volume=154 | hdl = 11250/180781 | s2cid = 8550726 | url = https://urn.kb.se/resolve?urn=urn:nbn:se:ltu:diva-24073 | hdl-access = free }}</ref> In particular, it is shown how a generalized Fibonacci sequence enters the control function of finite-horizon dynamic optimisation problems with one state and one control variable. The procedure is illustrated in an example often referred to as the Brock–Mirman economic growth model.
* [[Mario Merz]] included the Fibonacci sequence in some of his artworks beginning in 1970.{{sfn|Livio|2003|p=176}}
* [[Mario Merz]] included the Fibonacci sequence in some of his artworks beginning in 1970.{{sfn|Livio|2003|p=176}}
* [[Joseph Schillinger]] (1895–1943) developed [[Schillinger System|a system of composition]] which uses Fibonacci intervals in some of its melodies; he viewed these as the musical counterpart to the elaborate harmony evident within nature.{{sfn|Livio|2003|p=193}} See also {{slink|Golden ratio|Music}}.
* [[Joseph Schillinger]] (1895–1943) developed [[Schillinger System|a system of composition]] which uses Fibonacci intervals in some of its melodies; he viewed these as the musical counterpart to the elaborate harmony evident within nature.{{sfn|Livio|2003|p=193}} See also {{slink|Golden ratio|Music}}.
* In [[software development]], Fibonacci numbers are often used by [[Agile management|agile]] teams operating under the [[Scrum (software development)|Scrum]] framework to size their [[product backlog]] items.<ref>{{cite web |last1=Kathuria |first1=Madhur |title=A Guide to Using the Fibonacci Sequence in Scrum |url=https://resources.scrumalliance.org/Article/guide-using-fibonacci-sequence-scrum |website=Scrum Alliance |access-date=8 August 2025}}</ref>
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 Template:Math. Many writers begin the sequence with 0 and 1, although some authors start it from 1 and 1[1][2] 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.[3][4][5] 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 Script error: No such module "Lang"..Template:Sfn
Fibonacci numbers are also strongly related to the golden ratio: Binet's formula expresses the Template:Mvar-th Fibonacci number in terms of Template:Mvar and the golden ratio, and implies that the ratio of two consecutive Fibonacci numbers tends to the golden ratio as Template:Mvar 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.
File:Fibonacci Spiral.svgThe 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)
Under some older definitions, the value is omitted, so that the sequence starts with and the recurrence is valid for Template:Math.Template:SfnTemplate:Sfn
The Fibonacci sequence can be extended to negative integer indices by following the same recurrence relation in the negative direction (sequence A039834 in the OEIS): Template:Tmath, Template:Tmath, and Template:Tmath for Template:Math. Nearly all properties of Fibonacci numbers do not depend upon whether the indices are positive or negative. The values for positive and negative indices obey the relation:[6]
History
India
Script error: No such module "Labelled list hatnote".
The Fibonacci sequence appears in Indian mathematics, in connection with Sanskrit prosody.[4][7]Template:Sfn 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 Template:Mvar units is Template:Math.[5]
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].Template:Efn
Hemachandra (Template:Circa 1150) is credited with knowledge of the sequence as well,[3] writing that "the sum of the last and the one before the last is the number ... of the next mātrā-vṛtta."Template:Sfn[9]
Europe
File:Liber abbaci magliab f124r.jpgA page of Fibonacci's Script error: No such module "Lang". 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 Script error: No such module "Lang". (The Book of Calculation, 1202) by Fibonacci,Template:Sfn[10] where it is used to calculate the growth of rabbit populations.[11] 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 Template:Mvar-th month, the number of pairs of rabbits is equal to the number of mature pairs (that is, the number of pairs in month Template:Math) plus the number of pairs alive last month (month Template:Math). The number in the Template:Mvar-th month is the Template:Mvar-th Fibonacci number.[12]
The name "Fibonacci sequence" was first used by the 19th-century number theorist Édouard Lucas.[13]
File:Fibonacci Rabbits.svgSolution 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.
To see the relation between the sequence and these constants,Template:Sfn note that and are also roots of so the powers of and satisfy the Fibonacci recurrence. In other words,
In fact, the rounding error quickly becomes very small as Template:Mvar grows, being less than 0.1 for Template:Math, and less than 0.01 for Template:Math. This formula is easily inverted to find an index of a Fibonacci number Template:Mvar:
Instead using the floor function gives the largest index of a Fibonacci number that is not greater than Template:Mvar:
where , ,[16] and .[17]
Magnitude
Since Fn is asymptotic to , the number of digits in Template:Math is asymptotic to . As a consequence, for every integer Template:Math there are either 4 or 5 Fibonacci numbers with Template:Mvar decimal digits.
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 Template:Tmath:[18][19]
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 .
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 Template:Math:
For , it is also the case that and it is also the case that
Equivalently, the same computation may be performed by diagonalization of Template:Math through use of its eigendecomposition:
where
The closed-form expression for the Template:Mvarth element in the Fibonacci series is therefore given by
which again yields
This property can be understood in terms of the continued fraction representation for the golden ratio Template:Mvar:
The convergents of the continued fraction for Template:Mvar are ratios of successive Fibonacci numbers: Template:Math is the Template:Mvar-th convergent, and the Template:Math-st convergent can be found from the recurrence relation Template:Math.[21] 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 Template:Mvar, this matrix can be computed in Template:Math arithmetic operations,Template:Efn using the exponentiation by squaring method.
Taking the determinant of both sides of this equation yields Cassini's identity,
These last two identities provide a way to compute Fibonacci numbers recursively in Template:Math arithmetic operations. This matches the time for computing the Template:Mvar-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).[22]
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 Template:Mvar-th is equal to the Template:Math-th Fibonacci number minus 1.Template:Sfn 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 Template:Math-th Fibonacci number, and the sum of the first Fibonacci numbers with even index up to is the Template:Math-th Fibonacci number minus 1.[23]
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 Template:Mvar-th and Template:Math-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:
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[26]
with the Lambert series since
Millin's series gives the identity[29]
which follows from the closed form for its partial sums as Template:Mvar tends to infinity:
Primes and divisibility
Divisibility properties
Every third number of the sequence is even (a multiple of ) and, more generally, every Template:Mvar-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[30][31]
where Template:Math 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 Template:Tmath and Template:Tmath.)
In particular, any three consecutive Fibonacci numbers are pairwise coprime because both and . That is,
No Fibonacci number greater than Template:Math is one greater or one less than a prime number.[36]
The only nontrivial square Fibonacci number is 144.[37] Attila Pethő proved in 2001 that there is only a finite number of perfect power Fibonacci numbers.[38] In 2006, Y. Bugeaud, M. Mignotte, and S. Siksek proved that 8 and 144 are the only such non-trivial perfect powers.[39]
No Fibonacci number can be a perfect number.[41] More generally, no Fibonacci number other than 1 can be multiply perfect,[42] and no ratio of two Fibonacci numbers can be perfect.[43]
For odd Template:Mvar, all odd prime divisors of Template:Math are congruent to 1 modulo 4, implying that all odd divisors of Template:Math (as the products of odd prime divisors) are congruent to 1 modulo 4.Template:Sfn
Letting a number be a linear function (other than the sum) of the 2 preceding numbers. The Pell numbers have Template:Math. If the coefficient of the preceding value is assigned a variable value Template:Mvar, the result is the sequence of Fibonacci polynomials.
Generating the next number by adding 3 numbers (tribonacci numbers), 4 numbers (tetranacci numbers), or more. The resulting sequences are known as n-Step Fibonacci numbers.[51]
The Fibonacci numbers occur as the sums of binomial coefficients in the "shallow" diagonals of Pascal's triangle:Template:Sfn
This can be proved by expanding the generating function
and collecting like terms of .
To see how the formula is used, we can arrange the sums by the number of terms present:
These numbers also give the solution to certain enumerative problems,[52] the most common of which is that of counting the number of ways of writing a given number Template:Mvar as an ordered sum of 1s and 2s (called compositions); there are Template:Math ways to do this (equivalently, it's also the number of domino tilings of the rectangle). For example, there are Template:Math ways one can climb a staircase of 5 steps, taking one or two steps at a time:
The figure shows that 8 can be decomposed into 5 (the number of ways to climb 4 steps, followed by a single-step) plus 3 (the number of ways to climb 3 steps, followed by a double-step). The same reasoning is applied recursively until a single step, of which there is only one way to climb.
The Fibonacci numbers can be found in different ways among the set of binarystrings, or equivalently, among the subsets of a given set.
The Fibonacci numbers are also an example of a complete sequence. This means that every positive integer can be written as a sum of Fibonacci numbers, where any one number is used once at most.
Moreover, every positive integer can be written in a unique way as the sum of one or more distinct Fibonacci numbers in such a way that the sum does not include any two consecutive Fibonacci numbers. This is known as Zeckendorf's theorem, and a sum of Fibonacci numbers that satisfies these conditions is called a Zeckendorf representation. The Zeckendorf representation of a number can be used to derive its Fibonacci coding.
Starting with 5, every second Fibonacci number is the length of the hypotenuse of a right triangle with integer sides, or in other words, the largest number in a Pythagorean triple, obtained from the formula The sequence of Pythagorean triangles obtained from this formula has sides of lengths (3,4,5), (5,12,13), (16,30,34), (39,80,89), ... . The middle side of each of these triangles is the sum of the three sides of the preceding triangle.[54]
Fibonacci numbers are used in a polyphase version of the merge sort algorithm in which an unsorted list is divided into two lists whose lengths correspond to sequential Fibonacci numbers—by dividing the list so that the two parts have lengths in the approximate proportion Template:Mvar. A tape-drive implementation of the polyphase merge sort was described in The Art of Computer Programming.
Script error: No such module "anchor".A Fibonacci tree is a binary tree whose child trees (recursively) differ in height by exactly 1. So it is an AVL tree, and one with the fewest nodes for a given height—the "thinnest" AVL tree. These trees have a number of vertices that is a Fibonacci number minus one, an important fact in the analysis of AVL trees.[57]
The Fibonacci number series is used for optional lossy compression in the IFF8SVX audio file format used on Amiga computers. The number series compands the original audio wave similar to logarithmic methods such as μ-law.[59][60]
Some Agile teams use a modified series called the "Modified Fibonacci Series" in planning poker, as an estimation tool. Planning Poker is a formal part of the Scaled Agile Framework.[61]
Script error: No such module "labelled list hatnote".Script error: No such module "Labelled list hatnote".
File:FibonacciChamomile.PNGYellow chamomile head showing the arrangement in 21 (blue) and 13 (cyan) spirals. Such arrangements involving consecutive Fibonacci numbers appear in a wide variety of plants.
where Template:Mvar is the index number of the floret and Template:Mvar is a constant scaling factor; the florets thus lie on Fermat's spiral. The divergence angle, approximately 137.51°, is the golden angle, dividing the circle in the golden ratio. Because this ratio is irrational, no floret has a neighbor at exactly the same angle from the center, so the florets pack efficiently. Because the rational approximations to the golden ratio are of the form Template:Math, the nearest neighbors of floret number Template:Mvar are those at Template:Math for some index Template:Mvar, which depends on Template:Mvar, the distance from the center. Sunflowers and similar flowers most commonly have spirals of florets in clockwise and counter-clockwise directions in the amount of adjacent Fibonacci numbers,Template:Sfn typically counted by the outermost range of radii.[71]
Fibonacci numbers also appear in the ancestral pedigrees of bees (which are haplodiploids), according to the following rules:
If an egg is laid but not fertilized, it produces a male (or drone bee in honeybees).
If, however, an egg is fertilized, it produces a female.
Thus, a male bee always has one parent, and a female bee has two. If one traces the pedigree of any male bee (1 bee), he has 1 parent (1 bee), 2 grandparents, 3 great-grandparents, 5 great-great-grandparents, and so on. This sequence of numbers of parents is the Fibonacci sequence. The number of ancestors at each level, Template:Math, is the number of female ancestors, which is Template:Math, plus the number of male ancestors, which is Template:Math.[72][73] This is under the unrealistic assumption that the ancestors at each level are otherwise unrelated.
File:X chromosome ancestral line Fibonacci sequence.svgThe number of possible ancestors on the X chromosome inheritance line at a given ancestral generation follows the Fibonacci sequence. (After Hutchison, L. "Growing the Family Tree: The Power of DNA in Reconstructing Family Relationships".[74])
It has similarly been noticed that the number of possible ancestors on the human X chromosome inheritance line at a given ancestral generation also follows the Fibonacci sequence.[74] A male individual has an X chromosome, which he received from his mother, and a Y chromosome, which he received from his father. The male counts as the "origin" of his own X chromosome (), and at his parents' generation, his X chromosome came from a single parent (). The male's mother received one X chromosome from her mother (the son's maternal grandmother), and one from her father (the son's maternal grandfather), so two grandparents contributed to the male descendant's X chromosome (). The maternal grandfather received his X chromosome from his mother, and the maternal grandmother received X chromosomes from both of her parents, so three great-grandparents contributed to the male descendant's X chromosome (). Five great-great-grandparents contributed to the male descendant's X chromosome (), etc. (This assumes that all ancestors of a given descendant are independent, but if any genealogy is traced far enough back in time, ancestors begin to appear on multiple lines of the genealogy, until eventually a population founder appears on all lines of the genealogy.)
Other
In optics, when a beam of light shines at an angle through two stacked transparent plates of different materials of different refractive indexes, it may reflect off three surfaces: the top, middle, and bottom surfaces of the two plates. The number of different beam paths that have Template:Mvar reflections, for Template:Math, is the Template:Mvar-th Fibonacci number. (However, when Template:Math, there are three reflection paths, not two, one for each of the three surfaces.)Template:Sfn
Since the conversion factor 1.609344 for miles to kilometers is close to the golden ratio, the decomposition of distance in miles into a sum of Fibonacci numbers becomes nearly the kilometer sum when the Fibonacci numbers are replaced by their successors. This method amounts to a radix 2 number register in golden ratio baseTemplate:Mvar being shifted. To convert from kilometers to miles, shift the register down the Fibonacci sequence instead.[75]
The measured values of voltages and currents in the infinite resistor chain circuit (also called the resistor ladder or infinite series-parallel circuit) follow the Fibonacci sequence. The intermediate results of adding the alternating series and parallel resistances yields fractions composed of consecutive Fibonacci numbers. The equivalent resistance of the entire circuit equals the golden ratio.[76]
Brasch et al. 2012 show how a generalized Fibonacci sequence also can be connected to the field of economics.[77] In particular, it is shown how a generalized Fibonacci sequence enters the control function of finite-horizon dynamic optimisation problems with one state and one control variable. The procedure is illustrated in an example often referred to as the Brock–Mirman economic growth model.
Mario Merz included the Fibonacci sequence in some of his artworks beginning in 1970.Template:Sfn
Template:Replace on YouTubeScript error: No such module "Check for unknown parameters". - animation of sequence, spiral, golden ratio, rabbit pair growth. Examples in art, music, architecture, nature, and astronomy