{{Short description|Numbers obtained by adding the two previous ones}} {{For|the chamber ensemble|Fibonacci Sequence (ensemble)}} 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''}}}}{{space|hair}}}}. The initial elements of the sequence are {{math|1= ''F''{{sub|1}} = 1}} and {{math|1= ''F''{{sub|2}} = 1}}, though many authors also include a [[zeroth element]] {{math|1= ''F''{{sub|0}} = 0}}.Richard A. Brualdi, ''Introductory Combinatorics'', Fifth edition, Pearson, 2005Peter Cameron, ''Combinatorics: Topics, Techniques, Algorithms'', Cambridge University Press, 1994 Starting from {{math|''F''{{sub|0}}}}, the sequence begins : 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ... {{OEIS|A000045}} [[File:Fibonacci Squares.svg|thumb|A tiling with [[square]]s 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 {{lang|la|[[Liber Abaci]]}}.{{Sfn|Sigler|2002|pp=404–05}} 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 [[graph (discrete mathematics)|graphs]] called [[Fibonacci cube]]s used for interconnecting parallel and distributed systems. They also appear [[Patterns in nature#Spirals|in biological settings]], such as branching in trees, [[phyllotaxis|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|Binet's formula]] expresses the {{mvar|n}}-th Fibonacci number in terms of {{mvar|n}} and the golden ratio, and implies that the ratio of two consecutive Fibonacci numbers tends to the golden ratio as {{mvar|n}} increases. Fibonacci numbers are also closely related to [[Lucas number]]s, which obey the same [[recurrence relation]] and with the Fibonacci numbers form a complementary pair of [[Lucas sequence]]s. ==Definition== [[File:Fibonacci Spiral.svg|thumb|The Fibonacci spiral: an approximation of the [[golden spiral]] created by drawing [[circular arc]]s connecting the opposite corners of squares in the Fibonacci tiling (see preceding image)]] The Fibonacci numbers may be defined by the [[recurrence relation]]{{Sfn | Lucas | 1891 | p=3}} and for {{math|''n'' > 1}}. Under some older definitions, the value is omitted, so that the sequence starts with {{nobr|.{{Sfn | Beck | Geoghegan | 2010}}{{Sfn | Bóna | 2011 | p=180}}}} The first 21 Fibonacci numbers {{math|''F{{sub|n}}''}} are: :{| class="wikitable" style="text-align:right" ! {{math|''F''{{sub|0}}}} ! {{math|''F''{{sub|1}}}} ! {{math|''F''{{sub|2}}}} ! {{math|''F''{{sub|3}}}} ! {{math|''F''{{sub|4}}}} ! {{math|''F''{{sub|5}}}} ! {{math|''F''{{sub|6}}}} ! {{math|''F''{{sub|7}}}} ! {{math|''F''{{sub|8}}}} ! {{math|''F''{{sub|9}}}} ! {{math|''F''{{sub|10}}}} ! {{math|''F''{{sub|11}}}} ! {{math|''F''{{sub|12}}}} ! {{math|''F''{{sub|13}}}} ! {{math|''F''{{sub|14}}}} ! {{math|''F''{{sub|15}}}} ! {{math|''F''{{sub|16}}}} ! {{math|''F''{{sub|17}}}} ! {{math|''F''{{sub|18}}}} ! {{math|''F''{{sub|19}}}} ! {{math|''F''{{sub|20}}}} |- | 0 | 1 | 1 | 2 | 3 | 5 | 8 | 13 | 21 | 34 | 55 | 89 | 144 | 233 | 377 | 610 | 987 | 1597 | 2584 | 4181 |6765 |} 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:{{cite book | last = Vajda | first = Steven | author-link = Steven Vajda | year = 1989 | title = Fibonacci & Lucas Numbers, and the Golden Section: Theory and Applications | place = Chichester | publisher = Ellis Horwood | isbn = 0-7458-0715-1 | page = 10 }} == History == ===India=== {{see also|Golden ratio#History}} [[File:Fibonacci Sanskrit prosody.svg|thumb|Thirteen ({{math|''F''{{sub|7}}}}) ways of arranging long and short syllables in a cadence of length six. Eight ({{math|''F''{{sub|6}}}}) end with a short syllable and five ({{math|''F''{{sub|5}}}}) end with a long syllable.]] The Fibonacci sequence appears in [[Indian mathematics]], in connection with [[Sanskrit prosody]].{{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}}{{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) ...}}{{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}}}}.{{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)}} 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}}}}) is obtained by adding one [S] to the {{math|''F''{{sub|''m''}}}} cases and one [L] to the {{math|''F''{{sub|''m''−1}}}} cases.{{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}} [[Bharata Muni]] also expresses knowledge of the sequence in the ''[[Natya Shastra]]'' ({{Circa}} 100 BC–{{Circa}} 350 AD).{{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}} 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}}
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" {{Citation|last=Velankar|first=HD|year=1962|title='Vṛttajātisamuccaya' of kavi Virahanka|publisher=Rajasthan Oriental Research Institute|location=Jodhpur|page=101}}}}[[Hemachandra]] ({{Circa}} 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."{{sfn|Livio|2003|pp=197–198}}{{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|archiveurl=https://web.archive.org/web/20160706044528/http://www.northeastern.edu/shah/papers/Pingala.pdf|archivedate=2016-07-06}} ===Europe=== [[File:Liber abbaci magliab f124r.jpg|thumb|upright=1.25|A page of [[Fibonacci]]'s {{lang|la|[[Liber Abaci]]}} from the [[National Central Library (Florence)|Biblioteca Nazionale di Firenze]] showing (in box on right) 13 entries of the Fibonacci sequence: