new tasks
This commit is contained in:
parent
2a4d27cea0
commit
80737d5a6a
1194 changed files with 15353 additions and 1 deletions
6
Task/Ackermann_function/Python/ackermann_function-4.py
Normal file
6
Task/Ackermann_function/Python/ackermann_function-4.py
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
def ack2(M, N):
|
||||
return (N + 1) if M == 0 else (
|
||||
(N + 2) if M == 1 else (
|
||||
(2*N + 3) if M == 2 else (
|
||||
(8*(2**N - 1) + 5) if M == 3 else (
|
||||
ack2(M-1, 1) if N == 0 else ack2(M-1, ack2(M, N-1))))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue