Advertisement
OreganoHauch

Ackermann(4,1)

Mar 14th, 2020
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.17 KB | None | 0 0
  1. def ack(m, n):
  2. if m == 0:
  3. return n + 1
  4. if n == 0:
  5. return ack(m - 1, 1)
  6. else:
  7. return ack(m - 1, ack(m, n - 1))
  8.  
  9. print(ack(4, 1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement