I have a 20*20 chessboard and a very large box of identical cubes. Each square on the chessboard is the same size as the face of any cube. I am going to arrange piles of cubes on the chessboard in a special pattern. I align one edge of the board so it is running north-south. I start at the northwest corner by placing one cube on that square. Whenever I step to the south or the east, I place a pile of cubes containing one more cube than in the previous square. This produces the pattern in the following figure. How many cubes in total are there on the chessboard?

Answer below:

Actually, there is no need to use any difficult math. You can observe that there is a symmetry on the right side of the diagonal and the left side of the diagonal. They sum to 40. In fact, if you can visualize the shape of the cubes and cut the whole thing into half on level 20. Flip the one side to the other side, it is exactly n^3.