Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Problem with Recursion' topicStudent Support Forum > General > "Problem with Recursion"

Next Comment >Help | Reply To Topic
Author Comment/Response
pbollgruen
07/25/12 07:25am

Dear Mathematica Users,

i'm trying to do a recursion with a second variable, but it's not working. Is it possible to define such a function?

My attenpt was something like

f[n,x]:=1+(x^2)/f[n-1,k]
f[1,k]:=1

But when I now ask for something like f[3,1] the recursion exceeds the limit, my guess is that the second line is not recognized and the recursion goes on and on.

A recursion like
f[n_]:=1+(1^2)/f[n-1]
f[1]:=1
works fine, but I'd like to vary the x parameter, so I'd like to have it in there.

Thanks for your help!

URL: ,

Subject (listing for 'Problem with Recursion')
Author Date Posted
Problem with Recursion pbollgruen 07/25/12 07:25am
Re: Problem with Recursion Bill Simpson 07/25/12 1:34pm
Next Comment >Help | Reply To Topic