Problem 57646. Easy Sequences 93: Recursive Polynomial Function
For a natural number x and a polynomial function , we define a recursive function , as follows:
, and
, for .
For example, if (or in Matlab array form, P = [1 2 1]):
...
and so on...
We can see that can grow very quickly. Therefore, we will instead calculate: , that is, is equal to the logarithm (base-e) of the absolute value of .
Given a polynomial array P, and an integer x, find the value of , rounded-off to 4 decimal places.
----------------------
NOTE: To encourage vectorization , FOR and WHILE loops are disabled. If you know the math, this problem can be solved in less than 15 lines of code. However, solutions up to 50 lines of code will still be accepted. The semicolon (;), shall be considered as an end-of-line character.
Solution Stats
Problem Comments
-
1 Comment
Ramon Villamangca
on 7 Feb 2023
Update:
1. Up to 50 lines of code is acceptable solution.
2. Link to a website explaining recursive closed form is added.
Solution Comments
Show commentsProblem Recent Solvers2
Suggested Problems
-
Sum all integers from 1 to 2^n
15461 Solvers
-
241 Solvers
-
Remove white space from the string
194 Solvers
-
Replace multiples of 5 with NaN
441 Solvers
-
711 Solvers
More from this Author116
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!