@weaver20 What language are you using? Recursive means it calls itself... that isn't difficult. What you are asking is how to convert your equations into logic, and then into code.
I recommend you use a flow-chart, which will help you create the logic process, that can then be turned into an algorithm.