A pyramid is built by stacking up cubes:

There is one cube on the top, four cubes in the next layer, nine cubes in the one below that, and so on. Your task is to recursively compute the volume of such a pyramid. Assume that each cube has volume 1. You know the volume of the bottom layer. Add the volume of the pyramid that is obtained by removing the bottom layer.