How's this look?
def N(x):
if (x < 0):
return 0
if (x == 0 or x == 1):
return 1
return N(x-1) + N(x-2)
def N135(x):
if (x < 0):
return 0
if (x == 0):
return 1
return (N135(x-1) + N135(x-3) + N135(x-5))
def NArr(x, arr):
if (x < 0):
return 0
if (x == 0):
return 1
return sum([NArr(x - i, arr) for i in arr])
def main():
for n in range(10):
print(n, N(n))
for n in range(10):
print(n, N135(n))
for n in range(10):
print(n, NArr(n, [1,3,5]))
if __name__ == "__main__":
main()