Sums in a Grid

a---b---c---d---e---f
|   |   |   |   |   |
g---h---i---j---k---l
|   |   |   |   |   |
m---n---o---p---q---r
|   |   |   |   |   |
s---t---u---v---w---x
|   |   |   |   |   |
y---z---A---B---C---D
In a 4x5 grid of squares, the value in each square is determined by the sum of the digits placed at its four corners. Place any digit from 1-9 at each corner. The four corners of each square must be different. Try to achieve as many unique sums as possible.

Source: Original.


Solutions were received from Dan Chirica, Alan O'Donnell, Kirk Bresniker, Philippe Fondanaiche, Richard Mathar, and Joseph DeVincentis.  It turns out that, as stated, there are billions of solutions.  I asked a few solvers to try to find solutions where the minimum difference between neighboring sums is as large as possible.

Kirk Bresniker sent the following solution (one of many), finding a minimum difference of 4 between squares sharing a full edge:

sums = 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30
1 -- 2 -- 1 -- 2 -- 5 -- 8
| 15 | 11 | 16 | 22 | 29 |
9 -- 3 -- 5 -- 8 -- 7 -- 9
| 27 | 17 | 24 | 30 | 23 |
8 -- 7 -- 2 -- 9 -- 6 -- 1
| 20 | 13 | 19 | 26 | 14 |
2 -- 3 -- 1 -- 7 -- 4 -- 3
| 12 | 18 | 25 | 21 | 10 |
1 -- 6 -- 8 -- 9 -- 1 -- 2

Dan Chirica sent the following solution (one of many), finding a minimum difference of 3 between squares sharing either an edge or a corner:

Digits:
  1  2  1  2  5  1
  4  5  7  9  6  4
  9  8  3  8  7  8
  5  7  2  4  2  1
  9  3  1  3  5  3
Sums:
   12 15 19 22 16
   26 23 27 30 25
   29 20 17 21 18
   24 13 10 14 11


Mail to Ken