A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
16
Task/Ackermann-function/Maple/ackermann-function-3.maple
Normal file
16
Task/Ackermann-function/Maple/ackermann-function-3.maple
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
Ackermann := proc( m :: nonnegint, n :: nonnegint )
|
||||
option remember; # optional automatic memoization
|
||||
if m = 0 then
|
||||
n + 1
|
||||
elif m = 1 then
|
||||
n + 2
|
||||
elif m = 2 then
|
||||
2 * n + 3
|
||||
elif m = 3 then
|
||||
8 * 2^n - 3
|
||||
elif n = 0 then
|
||||
thisproc( m - 1, 1 )
|
||||
else
|
||||
thisproc( m - 1, thisproc( m, n - 1 ) )
|
||||
end if
|
||||
end proc:
|
||||
Loading…
Add table
Add a link
Reference in a new issue