___________________________________
| Stair | # of ways to get there |
|-------|---------------------------|
| 1 | =1 |
|-------|---------------------------|
| 2 | 1+1 or 2 =2 |
|-------|---------------------------|
| 3 | 1+1+1 or 2+1 or 1+2 =3 |
|-------|---------------------------|
| 4 | 1+1+1+1 or 1+1+2 or 1+2+1 |
| | or 2+1+1 or 2+2 = 5 |
|-------|---------------------------|
| 5 | etc. = 8 |
|-------|---------------------------|
| 6 | etc. = 13|
|-------|---------------------------|
| 7 | etc. = 21|
|-----------------------------------|
This is the Fibonacci Sequence so the algorithm would be just that. $$f_n=f_{n-1}+f_{n-2}$$