Sometimes, the elegant implementation is just a function. Not a method. Not a class. Not a framework. Just a function.
In order to understand recursion, one must first understand recursion.