Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The Fibonacci Sequence

is an infinite sequence of numbers that is defined as follows:

  • The 1st two numbers are 0 and 1.
  • The next numbers are generated by adding previous two numbers.

The first few numbers of the sequence are:

Concepts covered in this chapter

  • Using integers
  • Procedures and Recursion
  • Caching repeated computations
  • Analyzing the speed of your program