Exploring the recursion using the power of numbers algorithm