From The Sunday Times, 8th November 1981 [link]
The exclusive Ichthyophage Club was invited to hold its annual dinner at a resort on the Costa Fortuna last summer. Several members accepted the invitation, and each was asked to bring one of the local seafood specialities as their contribution to the feast.
The fare consisted of:
• the local edible starfish, which has five legs,
• the squid, which has ten,
• and octopus.
Each guest provided one such creature, and in fact more people provided octopus than provided starfish.
A chef was hired locally. He arranged the food so that each guest received a plateful consisting of the same number of legs — at least one leg from each species — but no guest’s plate was made up in the same way as any other guest’s plate. In other words, no guest had the same combination of legs on his plate as any other guest did.
When the food had been arranged in this way, the chef was grieved to find that all the legs had been used, leaving no edible fragments for him to take home to his family.
How many guests were there?
How many brought starfish, how many brought squid, and how many brought octopus?
This puzzle is included in the book The Sunday Times Book of Brainteasers (1994).
[teaser1006]
Jim Randell 8:13 am on 6 March 2026 Permalink |
Here is a solution using the [[
SubstitutedExpression]] solver from the enigma.py library, that is a direct interpretation of the puzzle text.The following run file executes in 86ms. (Internal runtime of the generated code is 5.8ms).
Solution: SOLVE = 95380.
We have:
LikeLike
ruudvanderham 2:45 pm on 6 March 2026 Permalink |
Very brute force:
for s, i, x, t, w, o, l, f, e, v in istr.permutations(range(10)): if (s | i | x) * (t | w | o) == (t | w | e | l | v | e) and (f | i | v | e).is_divisible_by(5) and (s | i | x).is_divisible_by(6): peek(s | o | l | v | e)and a bit less brute:
for five in istr.range(1000, 10000, 5): for six in istr.range(102, 1000, 6): if five[1] == six[1]: istr.decompose(five | six, "fivesix") if len(fivesix := set(five) | set(six)) == 6: for t, w, o in istr.permutations(set(istr.range(10)) - set(fivesix), 3): twelve = six * (two := t | w | o) if len(twelve) == 6: istr.decompose(twelve, "TWElVF") if T == t and W == w and E == F == e and V == v: if len({f, i, v, e, s, i, x, t, w, o, t, w, e, l, v, e}) == 10: solve = istr("=solve") peek(five, six, two, twelve, solve)LikeLike