Almost Magic

April 2022 : Puzzle

For the purposes of this puzzle, define a magic square to be a 3-by-3 grid of positive integers for which the rows, columns, and two diagonals all have the same sum. An example is shown top left; the 8 sums all equal 39.

An almost magic square is, well, almost a magic square. It differs from a magic square in that the 8 sums may differ from each other by at most 1. An example is shown top right; the sums are all 138 or 1391.

For this puzzle, place distinct positive integers into the empty grid above such that each of four bold-outlined 3-by-3 regions is an almost magic square. Your goal is to do so in a way that minimizes the overall sum of the integers you use.


[1] Not that it matters for this puzzle, but a magic square is, technically, also an almost magic square.