In the diagram, each of the numbers $0,1,2,3,4,5,6$, and 7 is to be used to label a vertex of the cube. The numbers 0,2 and 3 are placed as shown. The sum of the numbers at the ends of each edge must be a prime number. (Note: 1 is not a prime number.) The value of $M+N+P+Q$ must be
(A) 16
(B) 17
(C) 18
(D) 19
(E) 22

![](https://cdn.mathpix.com/cropped/2024_04_20_ac36362783317e0251fdg-099.jpg?height=285&width=287&top_left_y=1370&top_left_x=1445)
Solution 1

Accounting for all of the missing numbers, $M+N+P+Q+R=1+4+5+6+7=23$.

To determine the sum $M+N+P+Q$, we can determine the value of $R$ and subtract this from 23 .

$R$ cannot be 1 , since $0+1=1$ is not prime. (If $R$ was 1 , we would thus have the sum of the
numbers at the ends of one of the edges not equal to a prime number.)

$R$ cannot be 4 , since $0+4=4$ is not prime.

$R$ cannot be 6 , since $0+6=6$ is not prime.

$R$ cannot be 7 , since $2+7=9$ is not prime.

By process of elimination, $R=5$, so $M+N+P+Q=23-5=18$.

(We will see in Solution 2 that we can fill in the rest of the numbers in a way that satisfies the requirements.)

## Solution 2

The missing numbers are $1,4,5,6,7$.

Since $Q+3$ must be a prime number, then $Q$ must be 4 (since $1+3,5+3,6+3$, and $7+3$ are not prime).

Since $M+0$ and $M+4$ must both be prime numbers, then $M$ must be 7 (since $1+0,5+4$ and $6+4$ are not prime).

Since $P+2$ and $P+4$ must both be prime numbers, then $P$ must be 1 (since $5+4$ and $6+2$ are not prime).

Since $N+7$ and $N+1$ must both be prime numbers, then $N$ must be 6 (since $5+7$ is not prime).

We can check that if $R=5$, then the requirement that the sum of the two numbers at the ends of each edge be a prime number is met.

Thus, $M+N+P+Q=7+6+1+4=18$.

ANswer: (C)