# Time... to be prime?

A standard analogue clock face has numbers 1 to 12 around the edge arranged sequentially, which is nice for telling the time, but not especially interesting. It is possible to arrange the numbers in a different order so that the difference between any two adjacent numbers is prime.

For example, on the standard clock face, 3 lies between 2 and 4 and so the difference in either direction is not prime, being only 1. (For the sake of this puzzle all differences are treated as being absolute values, and so positive.) (Picture provided for completeness.) There are many ways of doing this of course (not even counting rotations) but the specific version to be found is one that alternates prime differences around the clock-face, with one unavoidable exception. So, if you have a (cyclic) sequence [n1, n2, ... n12] the prime differences must be p1, p2, p1, p2, ... with a final, different, p0.

• I tried an analytical approach, testing every different combination starting from 1. And I managed to fail because I forgot 2 is a prime number. Jan 8, 2021 at 14:37

I don't know if this sufficiently answers your question but I've found an example which has alternating prime differences all the way around so there isn't an "unavoidable exception".

10, 7, 5, 2, 4, 1, 3, 6, 8, 11, 9, 12

• That's better than my answer! Thank-you. Jan 7, 2021 at 16:14

Using a different pair of primes than in hexomino's accepted answer, and allowing one anomalous difference, I found the following solution:

Using prime differences 2 and 5:
1, 3, 8, 6, 11, 9, 4, 2, 7, 5, 10, 12
with the anomalous difference being 12-1=11.

I found this by choosing the two prime differences, and drawing a graph with the 12 numbers as vertices, and with edges of two colours representing the two prime differences. There was only one Hamiltonian path that alternated edge colours, giving the above solution.

I also tried a different pair of primes and this only yielded a near-solution:

Using prime differences 3 and 5:
11, 8, 3, 6, 1, 4, 9, 12, 7, 10, 5, 2 with the anomalous difference being 11-2=9, which is unfortunately not a prime.

Using a larger prime will not work, because

if you use 7, then neither of the numbers 6 or 7 can have a prime different of 7 in either direction, and there can be at most one such number.

• That's a really nice approach to it! I'd like to award you a bounty but I don't seem to have the privilege to do so yet :( Jan 7, 2021 at 16:38
• Now you do have the privilege! :) Jan 8, 2021 at 7:41