# Fourteen numbers around a circle

Place the numbers 1 to 14 around this circle so that both the sum and (absolute) difference of any two neighboring numbers is a prime.

• Was this an original question? Or do you have a source? – Dr Xorile Nov 29 '18 at 4:38
• @DrXorile: It is an original idea inspired on a question of Carlos Zuluaga (Colombia Aprendiendo). It first appeared in Number Play, Gary Antonnick's New York Times puzzle column. – Bernardo Recamán Santos Nov 29 '18 at 11:18

This appears to work, and I think it's unique but haven't checked super-carefully:

10 -- 13 -- 6 -- 11 -- 8 -- 3 -- 14 -- 9 -- 2 -- 5 -- 12 -- 1 -- 4 -- 7 -- (10)

• Was about to post this too, and I'm pretty sure it's unique because: there are 2 or 3 possibilities for the neighbours of each number, if 2 then it's forced, and then we can draw a graph for the remaining and there is only one cycle covering all numbers. – deep thought Nov 29 '18 at 3:03
• To expand a bit: 2,11,13,14 can each only be adjacent to two numbers, so that part of the sequence is forced, namely 3-14-9-2-5 and 10-13-6-11-8. 1 could neighbour 4,6,12 but 6 is now "taken" by 13 and 11, so 12-1-4 is forced. 4 could neighbour 9 but 9 is also taken, 1-4-7. 12 could neighbour 7 but that would close off a cycle of length 4. So 12 and 7 are forced: 7-10 and 5-12. 3 could neighbour 10 but that's taken. so 8-3. Done. – deep thought Nov 29 '18 at 3:18
• Sorry if I ninjaed you! Your reasons for saying it's unique are very much like mine (unsurprisingly) but since I hadn't bothered to write them out carefully I didn't want to claim too much :-). – Gareth McCaughan Nov 29 '18 at 4:04

## Uniqueness proof

The accepted answer by Gareth found the solution but didn't properly prove uniqueness. Just to complete the puzzle, let's derive that answer from first principles, showing that it's the only possibility.

Each number from $$1,2,3,4,5,6,7,8,9,10,11,12,13,14$$ only has a few possibilities for neighbours:

1 can only be adjacent to $$4,6,12$$;
2 can only be adjacent to $$5,9$$;
3 can only be adjacent to $$8,10,14$$;
4 can only be adjacent to $$1,7,9$$;
5 can only be adjacent to $$2,8,12$$;
6 can only be adjacent to $$1,11,13$$;
7 can only be adjacent to $$4,10,12$$;
8 can only be adjacent to $$3,5,11$$;
9 can only be adjacent to $$2,4,14$$;
10 can only be adjacent to $$3,7,13$$;
11 can only be adjacent to $$6,8$$;
12 can only be adjacent to $$1,5,7$$;
13 can only be adjacent to $$6,10$$;
14 can only be adjacent to $$3,9$$.

Four of these, namely $$2,11,13,14$$, can immediately be put next to both of their neighbours. So we get two chains of five on the circle:

$$5,2,9,14,3$$ and $$8,11,6,13,10$$ (not necessarily in the same order around the circle).

Now, after the above deduction, we get more restrictions on $$1$$ and $$4$$:

$$1$$ can't be next to $$6$$, and $$4$$ can't be next to $$9$$, so there's now only two possible neighbours for each of those, giving a chain of four: $$12,1,4,7$$.

Now the chains we've found cover all numbers, so we just need to figure out how to link them together.

The $$7$$ end of the last chain must connect to $$10$$ from the second chain. Now we have a chain of nine $$8,11,6,13,10,7,4,1,12$$ as well as the first chain of five. The $$3$$ end of the first chain must connect to $$8$$, so $$5$$ connects to $$12$$.

This proves that there is only one possible solution (up to rotation and reflection), namely the one found by Gareth.