Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
46 views
ubuntu2004
Kernel: Python 3 (system-wide)
def a(n): if n == 1: return 1 elif n == 2: return 2 elif n == 3: return 3 elif n == 4: return 4 else: return a(n-1)+a(n-2)+a(n-4)
a(20)
36894

This would mean that there are 36,894 ways you can walk up a set of stairs when using steps 1,2, and 4.