#MC1005. 信标塔
信标塔
Description
In "Minecraft", it is a common gameplay for players to build tower - shaped structures. Suppose a player wants to build a beacon tower, and the number of blocks on each layer increases according to a specific rule. One block is placed on the first layer. Starting from the second layer, the side - length of the block layer is more than that of the previous layer. Now, please write a recursive function to calculate the total number of blocks needed when building up to the nth layer.
Input Format
There is a line, and a positive integer (), representing the number of layers of the tower to be built.
Output Format
There is a line, and a positive integer, which is the total number of blocks needed when building up to the nth layer.
3
35
Explanation of the sample
There is block on the first layer, blocks on the second layer, and blocks on the third layer. In total, blocks.