RosettaCodeData/Task/Anonymous-recursion/Maple/anonymous-recursion-1.maple
Ingy döt Net db842d013d A-M baby
2013-04-10 21:29:02 -07:00

13 lines
397 B
Text

Fib := proc( n :: nonnegint )
proc( k )
option remember; # automatically memoise
if k = 0 then
0
elif k = 1 then
1
else
# Recurse, anonymously
thisproc( k - 1 ) + thisproc( k - 2 )
end
end( n )
end proc: