Post Reply 
Recursive sequences in CAS on prime.
06-19-2015, 02:12 PM
Post: #5
RE: Recursive sequences in CAS on prime.
(06-19-2015 10:33 AM)ww63 Wrote:  Hello Arne,

maybe your program runs faster, if you create two local variables, wich get the values of mf(n-1) and mf(n-2), so you have to do the recursive call only twice ind not three times.

regards

Wolfgang

Yes, you are right, a reduction of recursive calls is necessary. But your solution, I think, will not work with local variables as they are created each time when the function is called. Here additional Parameters are necessary to pass the last two values and then the solution with a for-loop seems better.
Arno
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Recursive sequences in CAS on prime. - Arno K - 06-19-2015 02:12 PM



User(s) browsing this thread: 1 Guest(s)