
Suppose the stairs consists out of one step. Then the staris can
be painted in two ways, see the figure above.
If the stairs have two steps, there are three possibilities.
If the stairs have three steps, there are five possibilities.
The rules for painting are:
After each yellow step there will be a green step.
After each green steps there will be either a yellow or a green step.
Let's call the number of ways in which the professor can paint
a stairs of x steps N(x). Then it is easily seen that the latest
step of a stairs with x steps can be painted green in N(x-1) ways.
De latest step of a stairs with x - 1 steps can be painted green in
N(x-2) ways. From this is follows that the latest step of a stairs
with x steps can be painted yellow in N(x-2) ways.
So the professor can paint a stairs of x steps in N(x) = N(x-1) + N(x-2) ways.
From the figure it follows that
N(1) = 2 en N(2) = 3.
Hence
| x | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 |
| N(x) | 2 | 3 | 5 | 8 | 13 |
21 | 34 | 55 | 89 | 144 |
A calculation learns that N(20) = 17711. The professor can paint his stairs in 17711 ways. Such a series is called the Fibonaci series, after an Italian mathematician. Most probably the professor is called Fibonaci.