Problem 42647. Recursion - Fun
Generate the first k terms in the sequence a(n) define recursively by
a(n+1)=p*a(n)+(1+a(n)) with p=0.9 and a(1)=0.5
Test Case
n = 2;
a = [a(1) a(2)] = [0.5000 1.9500]
Solution Stats
Problem Comments
-
6 Comments
Show
3 older comments
goc3
on 29 Sep 2020
Tolerance has been added to the test suite, in addition to removing a problematic case.
Ramon Villamangca
on 7 Mar 2023
Unrecognized function or variable 'tolerance'.
Dyuman Joshi
on 7 Mar 2023
I have updated the test suite to manually check the tolerance.
I find it weird that the way Grant defined tolerance as a variable and
used it for individual test cases works fine for some solutions but doesn't for other solutions. And this particular error has occurred on other problems as well.
Solution Comments
Show commentsProblem Recent Solvers39
Suggested Problems
-
Sum of diagonal of a square matrix
1589 Solvers
-
304 Solvers
-
07 - Common functions and indexing 1
436 Solvers
-
371 Solvers
-
9770 Solvers
More from this Author3
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!