Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Problem 292. Infernal Recursion

Created by Matt Fig

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

Tags

Problem Group

Solution Statistics

72 correct solutions 37 incorrect solutions
Last solution submitted on Feb 02, 2016

Problem Comments

Solution Comments