A stairway has 7 steps. John always walk up the stairs by taking
either 1 step or 2 steps or 3 steps at a time. How many ways can he
walk up the stairs?
The solution looks like this. (It might be wrong cos i vaguely
remember it to be like this only)
Suppose only 1 step, there will only be 1 way.
Suppose there are 2 steps, there will be 2 ways to go up.
Suppose there are 3 steps, there will be 4 ways to go up.
{1,1,1}{1,2}{2,1}{3}
Suppose there are 4 steps, there will be 1 + 2 + 4 = 7 ways to
go up.
Suppose there are 5 steps, there will be 2 + 4 + 7 = 13 ways
Suppose there are 6 steps, there will be 4 + 7 + 13 = 24
ways.
Suppose there are 7 steps, there will be 7 + 13 + 24 = 44
ways.
Answer: 44 ways.
My friend told me this is the advanced fibonacci sequence
whereby you add 3 terms instead of 2 terms.
Can someone check if there is any mistake and what is the real
formula called? And explain to me the rationale of adding
previous 3 terms?
Thanks in advance again.