Cell Numbering Sums

Before I started this blog, I explored polyominoes with cells individually labeled with numbers. I called these sumominoes, as I was looking at sets of all polyominoes with a given sum. Erich Friedman discovered them independently, and called them weightominoes in his July 2009 Math Magic Problem of the Month. I prefer his term for the general concept, as there is no reason they need to be grouped by sum. Both Friedman and I looked at problems where the goal was to overlap these polyominoes in a rectangle so that every cell had the same sum of labels. While I looked at a particular complete set, Friedman looked at pilings of multiple copies of the same cell numbered polyomino. (Aside: “pilings” isn’t a standard term, but it’s a concept we need a term for. We have “packings” for deficient tilings that don’t fill a space, so “pilings” for abundant tilings that fill it with overlap. Then a “tacking” is when there is both empty space and overlap, of course.)

All polyominoes with positive integer labels that sum to 4.

In this kind of problem we looked at sums of cells in the “z” direction. But we could instead look in the x and y directions. There is a common type of figure where we do this already: magic squares!

For this type of problem, excluding 0 as a potential cell label isn’t necessary. Standard numbered dominoes include 0 (blank) as a label, so we might want to do the same for physical puzzles using pips. (Pip patterns are preferable to numerals for physical puzzle pieces since they don’t have a preferred orientation.)

In fact, in the context of standard dominoes, examples have existed for some time. Here is a domino magic rectangle using a full set of double-six dominoes. The row sums are all 24, and the column sums are 21.

Solution from “The Existence of Domino Magic Squares and Rectangles”, by Michael Springfield and Wayne Goddard, graphic mine.

Of course, the fact that it can be done doesn’t make it a good puzzle, and working with a full set of dominoes might get tedious. Since I’ve been looking for simple puzzles with small piece sets, I tried to find one in this format. There are two cell numbered dominoes and four L-trominoes with a cell sum of 2. Their total area is 16, good for a 4×4 square,. and their total label sum is 12, giving a row and column sum of 3. One nice thing about a magic square type puzzle is you get an extra challenge for free. Finding a configuration with just row and column magic sums is a fairly light challenge, but getting the main diagonals to also match the magic sum is much harder. I had a small number of these made to give away at the 2022 MOVES conference:

Show Solution

Looking upward in size, there are 12 trominoes with a cell sum of 3, good for a 6×6 square with line sums of 6. I made a prototype:

But this isn’t quite as great as a puzzle, which is why I didn’t bother to conceal the solution as a spoiler. The reason is that it’s easy to make subunits where pip sums are preserved on applying a symmetry action. For example, in the solution above the three I trominoes in the upper left can be permuted in any order without changing row or column sums. Likewise, the two 2×3 rectangles formed from two L trominoes on the bottom can be flipped over one axis. This makes it much easier to turn a semimagic (row and column only) solution into one where the diagonals also work. (Subunits like these can appear in the smaller puzzles here, but there isn’t really enough room for them to dominate a solution.)

What I really want from going one step up from a 4×4 puzzle is a 5×5 one. Well, if we exclude the pieces with 3’s, we have an area of 24, which is almost right. We can make a 5×5, but it would have an unfortunate hole:

Or a fortunate one! Since my pips were lasered out holes to begin with, the big hole should clearly just count as one hole for the purpose of line sums. Now we have 25 holes, and 5 will work as the line sum. (While I normally like rounded corners for pieces since they have a softer tactile feel, if I made more of these, I’d use sharp corners and square pip holes, to visually unify the two different hole sizes.)

Show Solution

Is there anything else we can do with cell numbering? Polyhexes seem promising since there is an extra direction for sums to happen on. And perhaps we can use the numbers for something other than sums. I’m sure there are more creative discoveries waiting to be made!

Finally, a Magic Magic 45-omino

In the figure below, the numbers in each row, column, and main diagonal sum to 115:

Quite a long time ago, I came up with the idea of representing the lo shu (3×3 magic square) as a set of squares in a 9×9 grid, partitioned into nine 3×3 cells. The number of squares in each cell would correspond to a number in the lo shu. The most “magic” way to arrange the cells would seem to be to have 5 squares in the set in each row, column, and main diagonal. (This can be done because the lo shu’s magic sum of 15 can be divided among three rows or columns.) Although it doesn’t affect the “magicality” of a figure, I thought it aesthetically desirable for such a figure to be connected (i.e., a single polyomino) and hole-free. There are 12 hole-free magic 45-ominoes, if my code for discovering them is correct.

A figure with the same number of squares in each row, column, and main diagonal makes an ideal canvas for a sparse magic square. But with 45 numbers to place, and 20 constraints to meet, we start to push on the edge of what’s computationally feasible. The solver I wrote (which, I admit, might not have been very good) could not find a solution. Bryce Herdt manually tweaked the output of my solver to make a semimagic solution, that is, one where the rows and columns add to the magic sum, but the diagonals still didn’t work.

When I discovered that the Numberjack constraint engine could easily be used to code solvers for magic figures, I tried it on this problem, but got nowhere. The solver would run for an arbitrarily long period of time without spitting out any solutions. Recently I tried it again, and this time I got solutions. Paradoxically, what made the problem easier to solve was that I added more constraints. I manually placed the numbers 1 through 9 in the 3×3 cells that they correspond to. This seems to have made the search space small enough that the solver would not be able to spend an inordinate amount of time stuck in a barren zone.

Faux Shu Follies

lo shu

The Lo Shu, or 3×3 magic square, was discovered in China in antiquity. It is the only way, (up to symmetry) to place the numbers 1 through 9 in a 3×3 grid such that the numbers in each row, column, and main diagonal add up to the same number (or magic sum). This fact seems to be universally known among recreational mathematicians. So when I had the chance to meet a number of them this spring at the fabulous 12th Gathering for Gardner conference, I told them that I knew a different way to do it. When they pronounced me mad, or a liar, I showed them one of these:

show few faux shu

Mathematics is full of counterexamples that result when the simple way of understanding a conjecture is not exactly what the conjecture literally says, so this kind of cheating is totes legit.

If the fact of the uniqueness of the Lo Shu is new to you, a quick proof might be in order. First, let’s enumerate all of the sets of three numbers between 1 and 9 that sum to 15: {1, 5, 9}, {1, 6, 8}, {2, 4, 9}, {2, 5, 8}, {2, 6, 7}, {3, 4, 8}, {3, 5, 7}, {4, 5, 6}. There are eight sets, so we’ll need all of them to fill the eight lines in the magic square. The number 5 appears four times, the other odd numbers appear twice, and the even numbers appear three times. Therefore the center square, being part of four lines, must be 5, the corner squares, being part of three lines, must be the evens, and the side squares, being part of two lines, must be the other odds. Choose any corner, and put a 2 in it. That forces 8 into the opposite corner. Choose one the remaining corners, and put a 4 in it. After that, the rest of the numbers are forced. No matter what corners you choose, the result can be rotated or flipped to get the square formed by choosing any different pair of corners. Q. E. D.

Well, wait, you say, what if the magic sum isn’t 15? Quite right, 14 and 16 also both have eight sets of numbers between 1 and 9 that sum to them, so our proof is not done. I will leave it as an exercise to the reader to show that they cannot be used to form a 3×3 magic square.

And then, once the reader is satisfied, I’ll say: there is a way to place the numbers 1 through 9 in a 3×3 grid, with exactly one number in each cell, (you didn’t think I’d try the same shenanigans twice?) so that they occupy eight lines that each connect exactly three numbers that sum to 14. And having followed me this far, you are now enough of a recreational mathematician to be able to call me mad, or a liar. But you might want to have a look at this before you wager money on it:

d'oh shu

This result was adapted from one discovered by Lee Sallows, which is described in his book, Geometric Magic Squares.

Well, clearly the problem here is that you’re allowing me to draw my own graphics. If you forced me to use physical number tiles as in the first image, I couldn’t get up to any fancy tricks. So if I told you that I could arrange those exact same nine number tiles in a block of three rows of three tiles each, and make it so that for every line that passes through the center of three tiles that form a connected group, the sum of those tiles is 14, I would have to be mad.

this is not the cabbage water

Mad as a loon.

Magic figures from crossed stick configurations

When I was working on finding configurations to use in crossed stick puzzles, it occurred to me that the same configurations would make good bases for magic figures. Since each piece is a line segment with the same number of intersections, you could put numbers at intersection sites, trying to arrange them so that the numbers on each segment add up to the same magic sum. Since I had already figured out how to use Numberjack to solve magic figure problems in the context of magic dice, it was simple enough to adapt the code to solve other magic figures.

The puzzle that I’m selling as Grand Hex can form two different figures. Since they each have 24 intersection points, it seemed reasonable that one could use the numbers from 1 to 24 on the intersections, and get a magic figure with a magic sum of 50. And here’s one for each configuration:

magic-grand-hex-1

magic-grand-hex-2

The gold lines aren’t part of the original puzzle configurations, but they were the obvious places to add a few constraints, since the solver otherwise finds a very large number of solutions for the figures with just the black lines.