Infernal Recursion - MATLAB Cody - MATLAB Central

Problem 292. Infernal Recursion

Difficulty:Rate

Consider the recursion relation:

x_n = (x_(n-1)*x_(n-2))^k

Given x_1, x_2, and k, x_n can be found by this definition. Write a function which takes as input arguments x_1, x_2, n and k. The output should be x_n.

For example, if x_1=exp(1), x_2=pi, n=5, and k=5/9 then:

R = get_recurse(exp(1),pi,5,4/9)
R =
      2.31187497992966

Solution Stats

63.47% Correct | 36.53% Incorrect
Last Solution submitted on Apr 01, 2025

Problem Comments

Solution Comments

Show comments
Registration Now Open for MathWorks AUTOMOTIVE CONFERENCE 2025
...
Hello Community, We're excited to announce that registration is now open for the...

Problem Recent Solvers81

Suggested Problems

More from this Author6

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Go to top of page