It may be hard to define mathematical beauty,

but that is true of beauty of any kind.

— G.H. Hardy (1877–1947), A Mathematician's Apology


Fibonacci's Classic work, Liber Abaci, contains many elementary problems, including the following famous problem about rabbits:

Suppose there are two newborn rabbits, one male and the other female. Find the number of rabbits produced in a year if:

  • Each pair takes one month to become mature;
  • Each pair produces a mixed pair every month, beginning with the second month; and
  • Rabbits are immortal.

Suppose, for convenience, that the original pair of rabbits was born on January 1. They take a month to become mature, so there is still only one pair on February 1. On March 1, they are two months old and produce a new mixed pair, a total of two pairs. Continuing like this, there will be three pairs on April 1, five pairs on May 1, and so on; see the last row of Table 2.1.

Table 2.1 Growth of the Rabbit Population

Number of Pairs Jan Feb Mar Apr May Jun Jul Aug
Adults 0 1 1 2 3 5 8 13
Babies 1 0 1 1 2 3 5 8
Total 1 1 2 3 5 8 13 21


The numbers in the bottom row are called Fibonacci numbers, and the sequence c02-math-001 is the Fibonacci sequence. Table A.2 in the Appendix lists ...

Get Fibonacci and Lucas Numbers with Applications, Volume 1, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.