### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,393)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (61)
- site news (62)
- tantalizer (105)
- teaser (7)
- today (1)

### Site Stats

- 244,211 hits

Programming Enigma Puzzles

18 May 2020

Posted by on **From New Scientist #1702, 3rd February 1990** [link]

The twenty children on the school trip had labels on their lapels. The numbers from 1 to 20 inclusive were written on the labels, one number on each label.

The twenty children were told to form pairs. I noted that the

averagenumber of each pair was prime. And when I noted the ten primes obtained in this way I saw that the primes which occurred each occurred a different number of times.List the ten pairs.

[enigma549]

%d bloggers like this:

This Python 3 program runs in 116ms.

Run:[ @repl.it ]Solution:The pairs are: 1 & 3; 2 & 20; 4 & 18; 5 & 17; 6 & 16; 7 & 19; 8 & 14; 9 & 13; 10 & 12; 11 & 15.The averages and their occurrences are: