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 6:38 am on 5 April 2026 Permalink |
It is not possible for the times involved to be during the switch to/from daylight savings time, as both 100 and 200 have more than 2 factors.
From the format given in the example (01:43) I am assuming the display is a 24-hour clock.
The following Python program considers displays on a 24-hour clock between 21:00 and 05:59 the following morning.
It runs in 72ms. (Internal runtime is 961µs).
from enigma import (irange, prime_factors, tuples, cproduct, printf) # generate times that are products of <k> primes (21:00 - 05:59) def generate(k): for h in irange(21, 24 + 5): for m in irange(0, 59): # 24 hour clock n = 100*(h % 24) + m fs = list(prime_factors(n)) if len(fs) == k: # return (<minute-count>, <number>, <prime-factors>) yield (60*h + m, n, fs) # consider pairs of times ... for ((t1, n1, fs1), (t2, n2, fs2)) in tuples(generate(2), 2): # separated by 1 minute if not (t2 == t1 + 1): continue # and check the factors for (f1, f2) in cproduct([fs1, fs2]): if not (f1 > f2 > 9 and f1 % 100 == f2 % 100): continue # output solution printf("{n1} {fs1} -> {n2} {fs2}")Solution: [To Be Revealed]
LikeLike
Ruud 9:36 am on 5 April 2026 Permalink |
import istr from collections import namedtuple istr.int_format("04") candidates = {} for p0, p1 in istr.product(istr.primes(1, 1000), repeat=2): if (hour := (product := (p0 * p1))[:2]) <= 23 and (minute := product[2:]) <= 59 and p0 <= p1 and (hour < 8 or hour > 18): t = hour * 60 + minute candidates[t] = namedtuple("x", "primes time")((p0, p1), hour | ":" | minute) t0 = None for t1 in sorted(candidates): if t0 == t1 - 1 and any(p0x > p1x and p0x[-2:] == p1x[-2:] for p0x in candidates[t0].primes for p1x in candidates[t1].primes): print(candidates[t0].time, *map(int, candidates[t0].primes), candidates[t0].time, *map(int, candidates[t1].primes)) t0 = t1LikeLike
Frits 2:40 pm on 5 April 2026 Permalink |
@Ruud,
“primes(1, 1000)” seems to be too restrictive (eg ignoring time 23:06)
LikeLike