Recursion is a way to work with hierarchical data structures. But it's not very performant when you're dealing with large numbers. Sureti shows six different ways of solving the problem, each getting a little bit more performance or just doing it in a slightly different way.