Fibinacci number , F(n) = F(n-1) + F(n-2)
Fibonacci considers the growth of an idealized (biologically unrealistic) rabbit population, assuming that: a newly born pair of rabbits, one male, one female, are put in a field; rabbits are able to mate at the age of one month so that at the end of its second month a female can produce another pair of rabbits; rabbits never die and a mating pair always produces one new pair (one male, one female) every month from the second month on. The puzzle that Fibonacci posed was: 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 the female produces a new pair, so now there are 2 pairs of rabbits in the field.
- At the end of the third month, the original female produces a second pair, making 3 pairs in all in the field.
- At the end of the fourth month, the original female has produced yet another new pair, the female born two months ago produces her first pair also, making 5 pairs.
At the end of the nth month, the number of pairs of rabbits is equal to the number of new pairs (which is the number of pairs in month n − 2) plus the number of pairs alive last month (n − 1). This is the nth Fibonacci number.
i..e Rabit Pair Sequence => 1 1 2 3 5 8
1st month => 1 pair
2nd month => 1 pair
3rd month => 2 pairs
4th months => 3 pair
i.e in 5th month => F5 => F4 + F3
=> 3 +2 = 5 pairs
ref:
http://en.wikipedia.org/wiki/Gopala%E2%80%93Hemachandra_number#Origins