Problems & Puzzles: Puzzles

Puzzle 391. 9 dots and 8 lines graph*

A 3x3 magic square can alternatively be described as a graph containing 9 nodes connected by 8 straight lines, where each line connect 3 nodes.

You will recognize that this is the old and well known "Lo Shu" magic square that associates the 1-9 integers to the 9 dots, for a magic sum equal to 15 in each of the 8 lines (3 rows, 3 columns and 2 diagonals):

8+3+4 = 1+5+9 = 6+7+2 = 8+1+6 = 3+5+7 = 4+9+2 = 8+5+2 = 4+5+6 = 15

Question: Are there other distinct ways to connect 9 dots with 8 straight lines, each line connecting 3 dots, than the shown above?

Answer: Yes.

As a matter of fact there are more than one alternative way to connect 9 dots with 8 straight lines (I know for sure up to four alternative ways, but perhaps there are more than four)

I will show you just one alternative way, one devised by Lee Sallows not later than 2006.

(Sorry for the not-very-straight lines. I did my best with a drawing tool but I had not full success)

One nice feature of this alternative arrangement devised by Sallows is that now, the magic sum is equal to 16...

3+8+5 = 4+7+5 = 9+1+6 = 3+4+9 = 8+7+1 = 3+7+6 = 5+2+9 =8+2+6 = 16

I will ask for two more solutions only for the Lee Sallows "magic 9 dots and 8 straight lines graph". I hope that these two questions have solutions not-so-easy/not-so-hard to get and, of course, not published before...

Q1. Find the smallest magic sum solution using 9 primes, in the Sallows arrangement.

Q2. Find the smallest magic sum solution using 9 consecutive primes, in the Sallows arrangement.

* In the puzzles-files of my site, the puzzle 391 remained content-empty during 13 years, since 2006.
 I just kept the intended title in the web page. Why?... that's a good question... To tell the truth now I can not remember why this was so. Along this May month, after considering several weeks what to do, just this week I defined exactly what could be a good puzzle to fill this hole.


Contributions came from Paul Cleary, Miguel Angel Amela, Walter Trump, William Walkington, Giovanni Resta, Emmanuel Vantieghem, Claudio Meller, Dwane Campbell.

The contributions will be divided in two sections;

Section I: Answers to the explicit question of this puzzle, namely, Q1 & Q2

Section II: Contributions to the more general subject about the universe of the distinct graphs with 9 dots and 8 straight lines, and related issues.


Section 1:

Paul Cleary wrote on June-1-2019:

Q1.   I think this may be the smallest with primes :- {1669, 619, 1249, 1459, 829, 1879, 409, 2089, 1039},  with a sum of 3537.


Using the same primes they can be re-arranged as {829, 1879, 1249, 1039, 1669, 619, 2089, 409, 1459},to give a sum of 3957


One day after he wrote again:


I have since found a smaller magic sum for Q1.  The numbers are 2907 and 3327


For 2907


1 = 1875

2 = 1669

3 = 1459

4 = 1249

5 = 1039

6 = 829

7 = 619

8 = 409

9 = 199


For 3327


1 = 199

2 = 409

3 = 619

4 = 829

5 = 1039

6 = 1249

7 = 1459

8 = 1669

9 = 1875



One general formula for the magic sum that seems consistent is (Sum primes)/3 + (pb – ps)/8,  and (Sum primes)/3 - (pb – ps)/8


Where pb is the biggest prime and ps is the smallest prime.


Giving:-  (9351/3) + (1879 – 199)/8 and Giving (9351/3) - (1879 – 199)/8, giving 3327 and 2907.


One more day after he added:


Q2. I have managed to find a solution to the consecutive primes, the nine 79 digits primes are












giving a magic sum of








the authors of the AP records were Hans Rosenthal & Jens Kruse Andersen set in 2004 as the smallest known 9 CPAP and  Robert Piche set in 1998 for the largest know 9 CPAP. See




Miguel Ángel Amela wrote on Jun 1, 2019

Using the same arrangement of 8 lines, a solution with magic sum 14 it is possible.

interchanging 1 by 9 2 by 8 etc.(I suppose that Lee also will have found such a solution),


Walter Trump wrote on June 1, 2019

I am a little surprised. A short program for puzzle 391 found with smallest magic sum only a trivial solution for the problem Q1. This solution with magic sum 2907 can be derived by hand from Miguel’s construction by using the known 9 smallest equidistant primes. (Distance 210 and first prime 199.)  Is this really true or is there a bug in my program?


William Walkington wrote on June 1, 2019

Q2. If arithmetic progression is the key, could this be a reply to question 2 ? :

P1 = 9967943206670108648449065369585356163898236408099161839577_
     4048585529071475461114799677694651 (93 digits)

P2 = P1 + 210,  P3 = P2 + 210,  ...,  P9 = P8 + 210.

This was the first discovery of 9 consecutive primes in arithmetic progression back in 1998 with contributions from all over the world :

Perhaps with modern computers a smaller solution is possible.


Giovanni Resta wrote on June-1-2019

I wrote down the linear system corresponding to the Sallows' "magic 
square", i.e.

x3+x8+x5 = x3+x4+x9 = x4+x7+x5 = ... etc.

It seems to me that, contrary to the linear system corresponding to the 
classic 3x3 magic square, in this case all the entries are determined if 
just two values are fixed. In particular it appears that the only 
possible family of solutions is obtained when the entries are in 
arithmetic progression. In practice all the possible Sallows' magic 
squares are obtained from the one you depicted by changing the every 
entry x into x*a+b where a and b are two constants.

So, regarding question Q1, the smallest solution with primes should be 
the earliest set of 9 primes in arithmetic progression. They should be 
{199, 409, 619, 829, 1039, 1249, 1459, 1669, 1879}.

For question Q2 we need 9 consecutive primes in arithmetic progression, 
but it appears that the smallest such set is not known (because surely 
very large). The smallest known such set is reported in page and it is a number of 79 digits 
found in 2004 by Hans Rosenthal & Jens Kruse Andersen.


One day after Giovanni added: is very easy to prove that all the entries must be in AP: you change each entry into a variable, like you write x3 instead of 3, and for simplicity you call the common sum S, then you write all the 8 equations corresponding to the constraints, like 


You have 8 linear constraints and 10 unknowns (x1,...,x9, S), so the natural thing to try is to use two unknowns like parameters and then find the others as a function of the two you have fixed.

Doing so, one realizes that the linear system is well defined and has an unique solution.

In particular, using x1 and x2 as parameters, and then setting, without loss of generality, x1=a and x2=a+b, where a and b are two constants, one obtains x3=a+2b, x4=a+3b, x5=a+4b, x6=a+5b,..., x9=a+8b, i.e. the entries must be in AP, an AP that has x1 as starting point and the difference x2-x1 as step of the progression.

In particular, this means that the only two magic (with numbers 1,..,9) labeling of Sallows scheme are the one shown, corresponding to a=1, b=1, and the specular one with a=9, b= -1.


Walter Trump wrote on June 2, 2019

Proof of arithmetic progression Walter Trump, 2019-06-02

(Miguel's graphic)

8 equations

(1) g + b + e = S

(2) f + c + e = S

(3) a + i + d = S

(4) g + f + a = S

(5) b + c + i = S

(6) b + h + d = S

(7) g + c + d = S

(8) a + h + e = S

Differences of suitable equations with one common parameter

(6) – (8) b – a = e – d (9)

(5) – (3) b – a = d – c

(1) – (4) b – a = f – e

(1) – (8) b – a = h – g

(1) – (7) e – d = c – b with (9): b – a = c – b

(2) – (7) e – d = g – f with (9): b – a = g – f

(8) – (3) e – d = i – h with (9): b – a = i – h


D = i – h = h – g = g – f = f – e = e – d = d – c = c – b = b – a

The entries are in arithmetic progression. b = a + D, c = a + 2D, d = a + 3D, e = a + 4D, f = a + 5D, g = a + 6D, h = a + 7D, i = a + 8D

For arbitrary numbers a and D we obtain the same sum S for each line.

S = a + f + g = a + a + 5D + a + 6D then

S = 3a + 11D

There are exactly two solutions with numbers from 1 to 9.

Lee's solution: a = 9 and D = –1 S = 27 – 11 = 16

Miguel's solution: a = 1 and D = 1 S = 3 + 11 = 14


Claudio wrote on June 3, 2019



a los números, la solución prima con menor suma que encontré es :

A=1459, B=409, C= 1039, D= 1249, E= 619, F= 1669, G= 199; H= 1879 I= 829, Suma : 2907


Emmanuel wrote on June 3, 2019

Q1. This is the first solution I found with primes :

1249         619                   1039

199      1879                      829         
(in case this is not readable I send you a nicer picture in annex)
The eight sums being : 1039+409+1459 = 1039+619+1249 = 1039+1669+199 =
 409+619+1879 = 409+1669+829 =
1459+619+829 = 1459+1249+199 =
199+1879+829 = 2907.
There is another solution that uses the same primes but with the eight sums equal to 3327.
But I'm not sure I found the 'smallest solution'.


A little while after I sent you my first solution (to Q1) I was able to write any solution in the form :

a+4m                      a+m                        a+3m
a-m                   a+7m            a+2m                                               

(the numbers on a straight line sum up to 3a + 8m; observe also that  m  can be chosen negative).

Thus, the numbers used in any solution are members of an arithmetic progression  a-m, a, a+m, ... ,a+7m.

So, to find an answer to  Q2, we need a set of nine consecutive primes that form an arithmetic progression.
According to Wikipedia, that problem has been solved by very intensive computations.
The smallest prime of that set is  p = 99679432066701086484490653695853561638982364080991618395774048585529071475461114799677694651 (93 digits); the solution with smallest magic sum is the one for  which  a = p+210  and  m = 210.


Section 2:

Giovanni Resta wrote on June 1, 2019:

...For what regards other configurations of 9 points connected by 8 lines, 
there are a lot of possibilities. I'm quite challenged when it comes to 
draw or imagine objects in space, so to generate some configurations I 
used a different approach.

I started from the well-known solution of the so-called Orchard Planting 
Problem, that can be found here: , in 
particular I started from the solution with 9 points connected by 10 
lines, with 3 dots on each line. I also considered as viable the 4 
intersection that have no dots.

Then I considered all the possible sub-solutions with just 8 lines and 9 
points and I selected those distinct (with respect to the corresponding 
graph). I found 38 such solutions. See below.

The Sallows diagram is not isomorphic to any of these 38 solutions, but 
the last one is equivalent to the classic 3x3 magic square. Among the 
other 37 I found only 4 that can be "magic" with entries 1...9. See Below.

Clearly there are many other configurations to explore.

[Please notice that, according to the Resta's results, the only 4/37 new magic graphs are graphs with at least one empty intersection between the 8 lines, CR]

[Is there a pure topologic property that distinguish those graphs 9D8L with magic solution from these without magic solution? CR]


Lee Sallows wrote on June 3, 2019

Dear friends, I'm afraid that Carlos' latest two "solutions" 
fall a long way short in comparison with the solution to the puzzle 
with which he started (as he was kind enough to write and tell 
me).  In the first place recall that the original puzzle was as shown 
in the first attachment below.

The solution is thus not merely to reposition the 8 counters so as to 
yield the 8 colinear triads required, but to do so such that each 
counter lies within a distinct cell of the 3x3 array, a very 
significant extra demand. The second attachment shows my published 
solution along with another.

Can anyone come up with a third?

Original puzzle:

In the picture below, nine numbered counters occupy
the cells of a 3x3 board so as to form a magic square.
Any three counters lying in a straight line add up to the
same total: 15. There are 8 of these same-sum triplets:
8 + 1 + 6 = 15
3 + 5 + 7 = 15
4 + 9 + 2 = 15
8 + 3 + 4 = 15
1 + 5 + 9 = 15
6 + 7 + 2 = 15
8 + 5 + 2 = 15
6 + 5 + 4 = 15

Puzzle: Place the counters (again, one in each cell) so as
to yield 8 new in-line triplets, but now showing a common
sum of 16 rather than 15.

Two solutions by Lee Sallows

Later he added two more solutions sent by other people:

and one more from himself, but for magic sum = 15


On June 4, 2019 Dwane Campbell wrote:

Lee, I do not know if there is a numerical solution to the figure below but the geometry meets the requirements. If the circles in the bottom left and right squares are moved to the bottom then ten lines of three numbers are created.
A trivial solution would be to turn the Lo Shu order 3 square 45 degrees to make a diamond figure


One June 4, 2019, Miguel Ángel Amela wrote:

[Please note that the two solutions free of empty intersections sent by Miguel, is just one dual magic solution. But this is a new one solution!... Accordingly at this very moment we know only two magic solutions free of empty intersections: the Lo Shu's one and the Miguel's one. Are there more? CR]


On June 4, 2019, William Walkington wrote:

The enclosed sketch might satisfy the conditions for a third solution of 
the puzzle. After checking it looks like the solution 1, but seems 
slightly different. [3 empty intersections]

One day after he sent a second graph [2 empty intersections]:


On June 6, Walter Trump added one more solution:


During the week 7-14 June, 2019, more contributions came from Lee Sallows, Dwane Campbell, Miguel Ángel Amela and Walter Trump about issued related to the original Lee's puzzle. His original puzzle -is better to remind it in a precise manner- asks to find solutions to the 9D8L problem but includes the use of 9 counters of non-zero size that must be located inside the 9 cells of a bottom grid 3x3, one counter in each cell. The Lee's puzzle also demands that the magic sum equal to 16 (or 14 for its dual one)


Walter Trump sent the best update of the current status of the solutions. In this graphical summary, he left out the Hugo Diniz's because was recognized as a duplicate of the Lee's second solution, and added four new solutions by him. At the date there are a total of ten (10) distinct solutions.

Please notice that no one of these 10 solutions are free of empty nodes. An empty node is an intersection between two lines that has no counter in it. The quantity of empty nodes in these 10 solutions are: 3, 3, 1, 3, 2, 4, 2, 2, 3, 3, being the third one (by Palenstijn) the solution with less empty nodes (1).

Regarding this feature Walter Trump asks if there is any solution free of empty nodes?


Other than that, on June 7 and 8, 2019 Miguel Ángel Amela found that two graphs from Dwane Campbell has numerical solutions all with magic sum = 15.

From the first Dwane's graph MIguel Ángel Amela found four distinct solutions:

From the second Dwane's graph MIguel Ángel Amela found two distinct solutions:


On June 8, 2019, Lee Sallows sent a very interesting geometric variation of the well known Sho Lu magic square with MS=15.


On June 12, 2019 Walter Trump sent his 6th solution, for a total of 11 solutions to the original Lee's puzzle. His own comment is "The counters have to be very small and it seems that  2, 5, 9 and 1 are connected by a line. But 9 is a point on the line [1,6] and the line [9,5,2] has another slope than line [1,6]."


On June 13, 2019, Walter Trump announced that he made an exhaustive search for free-empty-nodes solutions for the 9D8L puzzle;

"I could not resist to do an exhaustive search for these 9D8L arrangements with mc=16 and  triangular shape and no empty node.
There are 3 solutions, no more with triangular shape: Miguel’s solution, my solution sent with the last email and this one.
(Again 8 faces)"

Here are these two new solutions by Trump:


Last, on June 14, 2019, Walter Trump sent a collection of nine (9) solution to the Lee's original puzzle, with magic sum = 16 such that  each of these 9 arrays has another number in the center. Please download it from here.



Records   |  Conjectures  |  Problems  |  Puzzles