This week’s Riddler Classic is a question about prime numbers.

Consider a cube, which has eight vertices, or corners. Suppose I assign a prime number to each vertex. A “face sum” is the value I get when I add up all four prime numbers on one of the six faces.

Can you find eight distinct primes and arrange them on a cube so that the six face sums are all equal?

Extra credit:Can you find another set of eight distinct primes that can similarly be arranged on the vertices of a cube? How many more can you find?

Extra Extra credit:Same puzzle for the other four platonic solids.

Here is my solution:

[Show Solution]

Let’s set aside the constraints that the numbers be prime and distinct for now, and focus on the structure of the solutions. Once we have characterized all solutions, we will reintroduce the constraints. Let’s label the vertices of the cube using the labels $x_1,\dots,x_4$ and $y_1,\dots,y_4$ as follows. This choice of labels will become clear later!

Since the faces must all have constant sum, which we’ll call $c$, we have the following six equations:

\begin{align}

x_1+y_2+x_3+y_4 &= c & y_1+x_2+x_3+y_4 &= c \\

y_1+x_2+y_3+x_4 &= c & y_1+y_2+x_3+x_4 &= c \\

x_1+x_2+y_3+y_4 &= c & x_1+y_2+y_3+x_4 &= c

\end{align}Notice that each equation contains exactly two $x$’s and two $y$’s. Also, each equation contains each index $1,2,3,4$ exactly once. If we compare pairs of equations in the same row, we deduce that:

\begin{align}

x_1-x_2 &= y_1-y_2 \\

x_2-x_3 &= y_2-y_3 \\

x_3-x_4 &= y_3-y_4

\end{align}In other words, The sequences $(x_1,x_2,x_3,x_4)$ and $(y_1,y_2,y_3,y_4)$ are just shifted versions of each other! So there must exist some $t$ such that $y_i=x_i+t$ for all $i$. Moreover, since each of the original equations contains exactly two $x$’s and two $y$’s, if we have any solution, we can add the same $t$ to all $x$’s or to all $y$’s and the result will always be a solution! We can visualize the $x_i$ and $y_i$ as vertices of tetrahedra inscribed inside the cube:

Each face of the cube contains exactly two vertices of each tetrahedron, so it makes sense that if we shift all numbers on the vertices of one of the tetrahedra by the same amount $t$, then all face sums increase by the same amount, $2t$.

**Solution:** Based on the findings above, we can check that the converse holds; if we choose numbers that satisfy the shifting property above, then they will also be solutions to the original six equations. In other words, we can generate *all* solutions to the problem by picking any five numbers $x_1,x_2,x_3,x_4,t$ and then setting $y_i=x_i+t$.

*Linear algebra side note:* the 6 original equations have 9 variables and the associated $6\times 9$ matrix has rank 4 (nullity 5), which is another way of explaining why the solution should have 5 independent degrees of freedom.

Now that we know the structure of all solutions, let’s re-introduce the constraints that the vertices be labeled with distinct prime numbers. All we have to do is pick a tuple of distinct prime numbers $(x_1,x_2,x_3,x_4)$ such that, when all numbers are shifted by the same amount, we obtain another tuple of prime numbers distinct from the first list. Here is one possibility:

\[

(7,11,13,17) + 30 = (37,41,43,47)

\]Visualized on the cube, this solution is:

We can check that all faces have the same vertex sum (108). This is by no means the only solution! We could have used a different shift:

\[

(13,17,19,23) + 24 = (37,41,43,47)

\]We could have also permuted the numbers in a different order, or used a different initial tuple. There are larger solutions, of course, such as:

\begin{align}

(53,139,167,173) + 84 &= (137,223,251,257)\\

(101,113,1447,1481) + 1260 &= (1361,1373,2707,2741)

\end{align}

**A natural question:** Clearly there are many possible solutions to this problem. But are there *infinitely many*? It turns out, yes! Thanks to @DimEarly on Twitter and Gnlc who pointed me to this family of results about prime numbers.

The Green-Tao theorem states that for every number $k$, there exists arithmetic progressions of primes with $k$ terms. This means there exists $a$ and $d$ such that

\[

a + n d \quad\text{is prime for }n=0,1,\dots,k-1.

\]We can use this to construct solutions. In particular, if we pick $k = 7m+1$, we have the solution

\[

(a,a+md,a+2md,a+3md) + 4md = (a+4md,a+5md,a+6md,a+7md)

\]It’s clear that if we pick $m=1,2,\dots$ then there will be infinitely many different possible values of $md$, and therefore this produces infinitely many different solutions.

### Extension to other platonic solids

@DeanDBallard (who designed this problem) also wondered about how to generalize this problem to other platonic solids. The other platonic solids are: tetrahedron, octahedron, icosahedraon, and dodecahedraon. The first three have triangular faces. We can immediately rule these out because since the faces only have three vertices each, the moment two faces share an edge, it forces the third vertex of each face to have the same value, which is forbidden (since all vertices must have distinct labels). So this leaves the dodecahedron, which is made up of 12 pentagonal faces (20 total vertices).

It turns out the trick we used with the cube works here as well. We can inscribe a tetrahedron in such a way that each face of the dodecahedron contains exactly one vertex from the tetrahedron. Here is what it looks like:

There are ten such tetrahedra (each vertex can belong to two possible tetrahedra). One way to see this is by drawing a flattened version of the dodecahedron; a so-called Schlegel diagram:

The red nodes (DOJQ) correspond to one of the tetrahedra. There is another tetrahedron that contains the point D; it is the mirror image (DMIU). Then, by rotational symmetry, we can find the other 8 tetrahedra. So given any solution to the problem, other solutions can be generated by adding the same quantity to each vertex of one of the tetrahedra. This gives us 10 degrees of freedom. Labeling them $a,b,c,d,e,f,g,h,i,j$, we obtain the following 20 equations for our node values:

\begin{align}

A &= d + i, &

B &= c + h, &

C &= b + g, &

D &= a + f, \\

E &= e + j, &

F &= d + h, &

H &= c + g, &

I &= b + f, \\

J &= a + j, &

K &= e + i, &

L &= c + j, &

M &= d + f, \\

N &= e + g, &

O &= a + h, &

P &= b + i, &

Q &= a + g, \\

R &= b + h, &

S &= c + i, &

T &= d + j, &

U &= e + f

\end{align}You can check that each face has vertex sum $a+b+c+d+e+f+g+h+i$, so everything checks out. Our task now is to pick values for $a,b,\dots,j$ so that each of the 20 numbers above is prime. Note that each letter corresponds to a different tetrahedron. For example, the letter $a$ is for the tetrahedron (DOJQ), and the equations that contain $a$ are precisely the equations for vertices D,O,J,Q.

It turns out that one of the tetrahedra is redundant and can be removed. This is because we can add the same quantity to all variables so that we shift one of them to zero. (you can also perform some linear algebra to show that the nullity of the associated $12\times 21$ matrix is 9, as we did in the cube example, so there should be 9 degrees of freedom. Therefore, let’s let $j=0$ without loss of generality, and we can eliminate $a,c,d,e$ to obtain:

\begin{align}

A &= T + i, &

B &= L + h, &

C &= b + g, &

D &= J + f, \\

E &= \text{(prime)}, &

F &= T + h, &

H &= L + g, &

I &= b + f, \\

J &= \text{(prime)}, &

K &= E + i, &

L &= \text{(prime)}, &

M &= T + f, \\

N &= E + g, &

O &= J + h, &

P &= b + i, &

Q &= J + g, \\

R &= b + h, &

S &= L + i, &

T &= \text{(prime)}, &

U &= E + f

\end{align}So we should begin by picking prime numbers $E,J,L,T$, and then picking numbers $b,f,g,h,i$ such that the remaining vertices are prime as well. We can take this one step further, eliminating $f,g,h,i$, and obtaining:

\begin{align}

& E,J,L,T,P,R,I,C\quad\text{prime} \\

A &= T+P-b & B &= L+R-b\\

K &= E+P-b & F &= T+R-b\\

S &= L+P-b & O &= J+R-b\\

D &= J+I-b & N &= E+C-b\\

U &= E+I-b & H &= L+C-b\\

M &= T+I-b & Q &= J+C-b

\end{align}This is the simplest parameterization I could find; we begin by picking $E,J,L,T,P,R,I,C$ prime, then we pick $b$ so that the remaining 12 values above are prime as well. There are infinitely many ways to do this. One way is to start with an arithmetic sequence of prime numbers of the form $x + n y$ for $n=1,\dots,23$ (possible via the Green-Tao theorem) then let $b=x$, and

\begin{align}

E&=x+y & J&=x+2y & L&=x+3y & T&=x+4y \\

P&=x+5y & R&=x+10y & I&=x+15y & C&=x+20y

\end{align}Substituting into the above, we obtain:

\begin{align}

A &= x+9y & B &= x+13y\\

K &= x+6y & F &= x+14y\\

S &= x+8y & O &= x+12y\\

D &= x+17y & N &= x+21y\\

U &= x+16y & H &= x+23y\\

M &= x+19y & Q &= x+22y

\end{align}And that does it! One possible sequence that works is (found here):

$x=11{,}664{,}645{,}664{,}537$ and $y=44{,}546{,}738{,}095{,}860$, though I’m sure there must exist smaller solutions!