I am new to maple and I want to define a number series as follows, but the error code is that there are too many levels of iterations. How to solve this problem?
g:=proc(x) g(x):=(sum(g(i),i=1..x-1))/(x!) end proc: g(1):=0:
Thanks in advance!
I am new to maple and I want to define a number series as follows, but the error code is that there are too many levels of iterations. How to solve this problem?
g:=proc(x) g(x):=(sum(g(i),i=1..x-1))/(x!) end proc: g(1):=0:
Thanks in advance!
Copyright © 2021 JogjaFile Inc.
Are you after something like this:
Inside the procedure, I could have written the recursive call as
g(i), but then its functionlity is tied to the name to which you assign it. By usingprocname(i)you are free to assign the procedure to another name.For a Maple procedure, having
option rememberis a kind of memoization. This speeds up this recursive procedure.Having
option systemmeans that the stored results will get automatically cleared when Maple performs a garbage-collection cleanup. You could remove that, if you prefer.