You are viewing a single comment's thread. Return to all comments →
Just to add, for further simplicity, you can consider:
A[0] = 1
ix < 0
A[ix] = 0
ix > 0
A[ix] = A[ix-3] + A[ix-2] + A[ix-1]
Seems like cookies are disabled on this browser, please enable them to open this website
Recursion: Davis' Staircase
You are viewing a single comment's thread. Return to all comments →
Just to add, for further simplicity, you can consider:
A[0] = 1
-- there is 1 way to climb zero stairsix < 0
:A[ix] = 0
ix > 0
:A[ix] = A[ix-3] + A[ix-2] + A[ix-1]