Magic Hexagon: the lovely maths behind 38
You only need addition to play. But underneath those nineteen little tiles is a surprisingly tight web of connections. Here is what is happening, one small idea at a time. You can read this without revealing the finished board.

1. Start with the shape
The board has five horizontal rows: three tiles, then four, then five, then four, then three. Add those row lengths and you get 19 spaces. Another way to count is to start at the centre: one middle tile, a ring of six neighbours, then an outer ring of twelve. So 1 + 6 + 12 = 19.
These are two ways of counting the same board, rather than two different layouts.
The small tiles are hexagons, meaning they have six sides. They fit together without gaps, just like a honeycomb. This arrangement gives us three families of straight lines.

2. Which lines count?
Look across the board and you can find five horizontal lines. Now follow the tiles diagonally down to the left: there are another five lines. Follow them down to the right and there are five more. That makes 5 + 5 + 5 = 15 lines to check.
In each direction, the lines contain 3, 4, 5, 4 and 3 tiles. A line must run straight through neighbouring tile centres. A zigzag or a route around the edge does not count. Tap one of the totals below the game to see its exact route.
Every tile belongs to three lines: one in each direction. That includes the outer tiles. This is why a number that looks perfect in one row can still cause trouble elsewhere.

3. Why is the target exactly 38?
It is not a number we chose to make the game difficult. It follows from the numbers on the tiles. The total of 1 through 19 is 190. You can check that without doing eighteen separate additions.
Pair the smallest number with the largest: 1 + 19 = 20. Then 2 + 18 = 20, and 3 + 17 = 20. Carry on until you have nine pairs, ending with 9 + 11. The number 10 is left in the middle. Nine lots of 20, plus 10, gives 190.
190 ÷ 5 = 38
The five horizontal rows use every tile exactly once. If those five rows all have the same total, each must contain one fifth of 190.
The same reasoning works for either diagonal family: its five lines also use every tile once. So 38 is the only possible shared total for this board when we use the numbers 1 to 19 once each.

4. Why not divide 190 by fifteen?
Because the fifteen lines overlap. When you add the totals of all fifteen lines, you count every tile three times, once for each direction. That gives 3 × 190 = 570. Fifteen lines of 38 also give 570. Both ways agree.
To divide the tile total fairly between lines, choose just one family of five. Within that family there is no overlap.

5. Short lines need bigger numbers, on average
A line of three tiles has to do the same job as a line of five: reach 38. That means the three-tile line needs an average of 38 ÷ 3, or about 12.67 per tile. A four-tile line needs an average of 9.5, and a five-tile line needs 7.6.
| Tiles in line | Total | Average per tile |
|---|---|---|
| 3 | 38 | About 12.67 |
| 4 | 38 | 9.5 |
| 5 | 38 | 7.6 |
This is a useful nudge, not a rule saying every outside tile must be large. A small number can belong to a short line if its companions make up the difference. For example, 4 + 15 + 19 = 38. That combination works as an addition, although it does not promise that all the crossing lines will work.

6. Think about the missing amount
Instead of asking “Which number should I try?”, ask “How much does this line still need?” Suppose two numbers in a three-tile line are 8 and 13. Together they make 21, leaving 38 − 21 = 17. The remaining space would need 17.
If the required number has already been used elsewhere, you have a choice to investigate. If the required number is 0, negative, or larger than 19, the current choices cannot complete that line. For instance, 4 and 9 leave 25, which is not one of our tiles. At least one of those choices must change.
With two spaces left, look for a pair. If the existing numbers total 23, the last pair must total 15. Possible pairs include 1 and 14, 2 and 13, or 7 and 8, provided those tiles are available and their crossing lines can also work.

7. A swap is a small balancing act
Suppose a line totals 34. It needs four more. Replacing a 7 on that line with an 11 increases its total by exactly four. That is a much more focused experiment than swapping at random.
But the 7 has to go somewhere: this is a swap, not a replacement from a spare pile. The other affected lines change too. Each swapped tile sits on three lines. If the two positions share a line, that shared line keeps the same total, because it still contains both numbers. The other lines through those positions may change.
Example: 34 − 7 + 11 = 38. Check the other affected totals before deciding whether the swap helped overall.
This also explains why a green line can disappear after a sensible-looking move. Green means its sum is right now; it does not prove every tile on it has reached its final home.

8. Odd and even numbers give another clue
The target, 38, is even. A line can therefore contain zero, two or four odd numbers, depending on its length. It cannot contain an odd number of odd tiles.
Why? Two odd numbers add to an even number. Adding an even number keeps a total even. But one unpaired odd number makes the total odd. So a three-tile line must contain either no odd numbers or two; three odd numbers cannot work.
This check will not solve a line by itself. It is a quick way to rule out a combination before spending time on it.

9. Why is it harder than it looks?
Making one line total 38 is quite easy. Making fifteen overlapping lines do it together is the challenge. There are 19 choices for the first space, 18 for the next, then 17, and so on. Multiplying those choices gives 19 factorial, written 19!.
That counts all placements of nineteen different tiles before checking any sums. Most can be ruled out quickly with the clues above.
You do not need to search that enormous list. A computer can use the same kind of reasoning: place a number, check whether the nearby lines can still work, and backtrack when a choice makes a solution impossible. Backtracking simply means returning to an earlier decision and trying a different route.

10. Is there more than one solution?
For the classic 1–19 puzzle, there is one underlying solution if we treat rotations and mirror images as the same pattern. Turn a solved board through 60 degrees and it still works. Reflect it in a mirror and the line totals still work too. Together these give twelve orientations of the same solution.
Our Challenge mode accepts any arrangement that makes every line total 38. Easy mode fixes seven tiles in one orientation. The Hint button guides you towards the particular solution used to prepare the puzzle, so a hint is help towards that layout rather than proof that your previous move was wrong.
11. A calm way to get started
- Begin with a short line. It has fewer numbers to juggle.
- Work out the missing amount, or the pair you still need.
- Inspect the two other lines through a tile before moving it.
- Use the difference between tile values to plan a swap.
- Keep an eye on green totals, but allow yourself to disturb one when exploring a better arrangement.
Try Easy first to get a feel for the connections. The locked tiles give you firm reference points. When you want the whole puzzle to yourself, Challenge lets every tile move. There is no deadline: noticing a useful relationship is part of the pleasure.
Further reading: Wolfram MathWorld: Magic Hexagon · Frank R. Kschischang, University of Toronto: The Magic Hexagon. The worked examples above illustrate the arithmetic; they are not a finished-board reveal.