RosettaCodeData/Task/Ackermann-function/Maple/ackermann-function-1.maple
2023-07-01 13:44:08 -04:00

10 lines
243 B
Text

Ackermann := proc( m :: nonnegint, n :: nonnegint )
option remember; # optional automatic memoization
if m = 0 then
n + 1
elif n = 0 then
thisproc( m - 1, 1 )
else
thisproc( m - 1, thisproc( m, n - 1 ) )
end if
end proc: