If the ladder has two levels, the little monkey has two ways to climb in the middle;
If the ladder has three steps, the little monkey has four ways to climb;
If the ladder has 4 levels, there are 1+2+4 = 7 climbing methods.
That is to say,
It can climb 1 ladder first, and then reach the fourth ladder directly (the number of such methods = the number of ways it climbs 1 ladder).
It can also climb the second step first and then reach the fourth step directly (the number of such methods = the number of ways it climbs the second step).
It can also climb the third step first and then reach the fourth step directly (the number of such methods = the number of ways it climbs the third step).
To sum up, for the nth step,
It can climb the n-3 ladder first, and then reach the n-3 ladder directly (the number of such methods = the number of ways it climbs the N-3 ladder).
It can also climb the n-2nd ladder first, and then reach the n-th ladder directly (the number of such methods = the number of ways it climbs the n-2nd ladder).
It can also climb the n- 1 ladder first, and then reach the fourth ladder directly (the number of such methods = the number of ways it climbs the n- 1 ladder).
So the recurrence formula of this series is:
a 1 = 1
a2 = 2
a3 = 4
a(n) = a(n- 1) + a(n-2) + a(n-3)
therefore
a4 = 1 + 2 + 4 = 7
a5 = 2 + 4 + 7 = 13
a6 = 4 + 7 + 13 = 24
a7 = 7 + 13 + 24 = 44
-
Of course, there is a general formula in theory.
It is conceivable that its derivation process is inevitably more difficult than Fibonacci sequence. This will be another problem.
According to the recursive formula, it's not too much trouble. Even if there is a formula, it will be more troublesome. For example, Fibonacci series, calculated according to the general formula, involves complex binomial expansion. So it is not as simple as recursive formula.