# Sunday Times Teaser 2817 – Our Secret

### by Victor Bryant

#### Published: 18 September 2016

Eight friends joined a very secret society and each was given a different membership number between 70 and 100. The friends are Bec, Cal, Doc, Ian, Jon, Luv, Rev and one other – and I am not willing to divulge his common three-letter name. But I can tell you that his membership number is 84.   Also, Bec’s membership number is the highest of the eight. The friends noticed that, for any pair of them, their names had at least one letter in common if and only if their membership numbers had a common prime factor.

(a) What was Ian’s membership number?

(b) What was the name of the eighth friend?

My first fully programmed solution of this teaser was close to Jim’s below but my manual exploration revealed the possibility for a one-to-one mapping from shared letters to shared primes, so I looked for a solution that exploited such a relationship. This is the same approach as that used by Arthur below and turns out to be faster, although a lot longer, than my first solution.

2. Here’s my solution.

It outputs a list of possible names for the mystery man. You can select the most appropriate.

I used a few useful routines from the enigma.py library [ https://www.magwag.plus.com/jim/enigma.html ]

Each pair of the 7 names Bec, Cal, Doc, Ian, Jon, Luv, Rev has at most one letter in common. There are 7 of these letters: v, e, c, l, a, n, o.

Each of the 7 names Bec, Cal, Doc, Ian, Jon, Luv, Rev has a letter in common with at least 2 other names.

The only primes with 2 or more multiples between 70 and 100 are 2, 3, 5, 7, 11, 13, 19.

So we can consider the letters v, e, c, l, a, n, o to be some permutation of 2, 3, 5, 7, 11, 13, 19 and the membership number to be a multiple of the product of the letters v, e, c, l, a, n, o in the name.

For example, bec is a multiple of e * c, and, furthermore, it is co-prime with all the primes 2, 3, 5, 7, 11, 13,19 that are neither e or c.

However, unlike Jim’s program, mine only finds the eighth friend’s name “Vac”, and fails to find the name “Vic”, which is presumably the name that Victor Bryant intended to be found.

Hi Arthur

I found your programme needs an extra line to run under Python 3
( after amending the xrange and print statements)

ie from functools import reduce

Maybe needed for Python 2.7 too?

Geoff