The puzzle is to find the, smallest*, unique**, whole, non-negative, numbers to write on the faces of two dice such that the numbers you see on each dice after rolling sum equals a prime number.(including 1 as a prime) *(the size is determined by adding the values of all sides of both dice together to get the total) **(unique refers to no duplicate numbers between the two dice)
I can't figure out if the solutions I came up with are the smallest can someone help me? also I can't figure out the 6 sided solution. And is there a large number of sides for which there is no solution?
- sided dice (1),(0) total 1
- sided dice (1,3),(0,2) total 6
- sided dice (1,5,11),(0,2,6) total 25
- sided dice (1,7,13,37),(0, 4,6,10) total 78
- sided dice (47,251,557,587,1217),(0,6,12,14,20) total 2711
1. Solutions for $n$-sided dice
There is always a solution for any pair of $n$-sided dice due to existence of arbitrarily long sequence of primes in arithmetic progression.
Consider sequences $\geq 4$ so that first element must be odd and difference must be of the form $2d$. We choose a sequence of length $2n-1$: $$ S = \{a,a+2d,a+4d,\dots,a+2(2n-2)d\} $$ so that every element in $S$ is prime. Then we let dice one $D_1$ and dice two $D_2$ have the values $$ \begin{align*} D_1 &= \{a,a+2d,a+4d,\dots,a+2(n-1)d\}\\ D_2 &= \{0,2d,4d,\dots,2(n-1)d\}\\ \end{align*} $$ The sum of element pairs are of the form $a+2id$ for $0\leq i\leq 2n-2$, hence all of them are prime. This shows that there is a solution for any $n$, although it need not be the minimal one.
2. Minimal solutions
Solutions for $n<3$ is clear so we solve $3\leq n\leq 6$. Then, without loss of generality, $D_1$ and $D_2$ must have odd and even integers respectively. Otherwise the sum consists of even integers, which would not be prime.
Now given inputs in ascending order ($a_k<a_{k+1},b_k<b_{k+1}$), $$ \begin{align*} D_1 &= \{a_1,a_2,\dots,a_n\}\\ D_2 &= \{b_1,b_2,\dots,b_n\} \end{align*} $$ we can add all integers in $D_1$ by $b_1$ and subtract all integers in $D_2$ by $b_1$ to get $$ \begin{align*} D_1 &= \{a_1+b_1,a_2+b_1,\dots,a_n+b_1\}\\ D_2 &= \{0,b_2-b_1,\dots,b_n-b_1\} \end{align*} $$ This gives the same sums and the overall cost is unchanged since we added $nb_1$ and subtracted $nb_1$. This shows that we can assume $0\in D_2$ and hence all integers in $D_1$ are primes.
Using this, we solve the minimal problem via a bruteforce search. As long as we have found a potential solution, the sum gives an upper bound $B$ of the primes that can be involved. We then iterate through all the possible combinations of primes in $D_1$ summing to $\leq B$. Then we search for elements $\geq 2$ in $D_2$ that gives sums of primes ($0$ is always included).
For example, the bound $T=290$ below for $n=6$ tells us that the maximum possible prime in $D_1$ is $283$ (actually $241$ considering the other elements' minimum weights).
Let total sum of the integers be $T$. The solution for $3\leq n\leq 6$ is then: $$ \begin{align*} n=3 &: D_1=\{1,3,7\}, D_2=\{0,4,10\}, T=25 \\ n=4 &: D_1=\{1,3,7,13\}, D_2=\{0,4,10,16\}, T=54\\ n=5 &: D_1=\{1, 3, 7, 13, 43\}, D_2=\{0,4, 10, 16, 40\}, T=137\\ n=6 &: D_1=\{1,7,11,17,31,67\}, D_2= \{0,6,12,30,36,72\}, T=290 \end{align*} $$ Edit1: added a $0$ for $n=6$.