I want to input a recursive sequence into a program for the computer to calculate it, but I am having some trouble doing so.
Does anyone have any bright ideas to represent this sequence?
a_n = sqrt(x)
a_n+1 = sqrt(x + a_n)
This is my code...thanks for any input.
float sequence (float x, int recurse);
limit = sequence(3, -20);
float sequence (float x, int recurse)
if ( recurse )
answer = sqrt(x + sequence(answer, recurse++) );