How can I write the following function in a more efficient manner to reduce the number of recursive calls made?
declare
fun {Calc N}
if N == 0 then 2
elseif N == 1 then 4
elseif N == 2 then 8
else {Calc N-1}+{Calc N-2}+{Calc N-3}
end
end