Answer:
5376
Explanation:
Let us consider the 3 × 3 square that starts at the top-left corner of the board. There are two 3-cell "angles" in this square, one in the top-left corner and one in the bottom-right corner. Since the sum of the numbers in each 3-cell "angle" is 42, the sum of the numbers in this 3 × 3 square is equal to twice that, or 84.
We can slide this 3 × 3 square over by one cell to the right to get another 3 × 3 square. This new square shares a 2-cell "angle" with the previous square, and this "angle" has a total sum of 42. However, there is one cell in the new square that is not in the old square, and there is one cell in the old square that is not in the new square. So the sum of the numbers in this new square is 84 - 2 + 2x, where x is the number in the cell that is in the new square but not in the old square. Since x is a positive integer, the sum of the numbers in this new square is less than 84.
We can repeat this process, sliding the 3 × 3 square over by one cell at a time until we have covered the entire 8 × 8 board. Each time we slide the square over, we add the sum of the numbers in the new square minus the sum of the numbers in the old square. Since the sum of the numbers in each 3-cell "angle" is 42, the sum of the numbers in each 3 × 3 square is 84. Therefore, the sum of all the numbers on the board is:
84 + (84 - 2 + 2x) + (84 - 2 + 2y) + ... + (84 - 2 + 2z)
where x, y, ..., z are the numbers in the cells that are not included in any of the previous squares. Since there are 64 cells on the board, and each of the numbers x, y, ..., z appears exactly once, the sum of all the numbers on the board is:
64·84 - 2(1 + 2 + ... + 63) = 5376
Therefore, the sum of all the numbers Peter wrote is 5376.