Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def n_p(x, y):
- if x > y:
- return 0
- if x == y:
- return 1
- if x < y:
- return n_p(x+1, y) + n_p(x+2, y) + n_p(x*3, y)
- print (n_p(1, 8)*n_p(8, 27) - (n_p(1, 27) - n_p(1, 10)*n_p(10, 27)) - (n_p(1, 27) - n_p(1, 11)*n_p(11, 27)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement