Interesting pattern that I found while finding dice that always roll a prime number

299 Views Asked by At

The original puzzle I was trying to solve is to find unique numbers to write on the faces of two dice such that the numbers you see on each dice after rolling sum to a prime.

I realized that for this to work, one dice should have all even numbers and the other odd numbers to exclude all multiples of 2 in the sum. I decided to fix the faces of

dice_1 to [2, 4, 8, 16, ..., 64] and 
dice_2 to [1, 3, 5, ..., 11]

and then, add each element of dice_2 to elements of dice_1 and see if any sum is a prime. If yes, I'll move on to the next element in dice_2. Else, I'll set that element to max(dice_2) + 2 and iterate till a solution is found.

I found smallest numbers that can be put in dice_2:

dice_2 = [15, 1605, 2655, 17385, 19425, 24105]

similarly, for dice with 7 faces each:

dice_1 = [2, 4, 8, 16, 32, 64, 128]
dice_2 = [1605, 19425, 65835, 97545, 499125, 1210395, 1447215]

I also checked for dice with 5 faces each. The curious thing is that, every number in dice_2 is divisible by 15 (that I checked). Is there some reason for the pattern I observe? Suppose I find larger numbers to put in dice_2, will this pattern still hold for all of them?

1

There are 1 best solutions below

0
On BEST ANSWER

2 generates the groups of units mod both 3 and 5. Therefore (as long as you've got at least 4 side on dice_1), every residue class mod 3 and every residue class mod 5 appears on the first die. If any non-zero residue class appeared on the second die, its additive inverse would appear on the first, giving you a sum that is divisible by 3 or 5.