From The Sunday Times, 9th July 1989 [link]
Five families, each consisting of a mother, father, and one child, are near neighbours. The families have a lot in common, and, to give you some idea of the closeness, I will tell you that last Saturday all 15 family members went on an outing to the circus to celebrate young Laura’s 10th birthday.
The day before that, four of the mothers, Jenny, Lorna, Margaret and Norma, had been on a shopping spree together, and two of the fathers, Ken and John, had prepared a barbecue for all the others. Three of the children, Kevin, Marion and Nigel, are learning the piano under the same teacher.
Mike and Neil are the fathers of daughters. Young Jill, who is not Neil’s child, shares a birthday with Leo’s child (who has the same initial as Mike’s wife) and with Kate’s child (who has the same initial as Leo’s wife). The other two children share a birthday on a different date.
If I tell you that no two members of a family have the same first name initials as each other, you should be able to work out the name of John’s wife and who it was that shared Laura’s birthday last week.
There are now 1400 Teaser puzzles available on the site, so it seemed like an appropriate time to post Teaser 1400.
Between S2T2 and Enigmatic Code there are now 4056 puzzles available in total.
[teaser1400]
Jim Randell 7:48 am on 1 November 2026 Permalink |
I wasn’t sure if we were to discard rearrangements that had a leading zero. Although in the end it doesn’t matter if we do or not.
This Python program is a straightforward search of all multiples of 3 in the range [100, 400] with the property, and then checks if (n − 1) also has the property.
It runs in 71ms. (Internal runtime is 4.3ms).
from enigma import (irange, subsets, nsplit, nconcat, primes, printf) # primes up to 3 digits primes.expand(999) # 3-digit numbers that are the sum of two primes sum_of_primes = set() for p in primes.between(2, 500): sum_of_primes.update(p + q for q in primes.between(max(p, 100 - p), 999 - p)) # 3-digit numbers that are the difference of two squares diff_of_squares = set() for a in irange(0, 500): sq_a = a * a for b in irange(a, 0, step=-1): d = sq_a - b * b if d > 999: break if d < 100: continue diff_of_squares.add(d) # check number <n> def check(n): # rearrangements of the digits of the digits of <n> ns = list(subsets(nsplit(n), size=len, select='mP', fn=nconcat)) # total number of rearrangements t = len(ns) # <t> are sum of two primes if len(sum_of_primes.intersection(ns)) != t: return False # (2/3) <t> are diff of two squares if 3 * len(diff_of_squares.intersection(ns)) != 2 * t: return False # looks good return True # consider possible multiples of 3 for n in irange.round(100, 400, step=3, rnd='I'): if check(n) and check(n - 1): printf("n = {n}")Solution: [To Be Revealed]
LikeLike
Ruud van der Ham 9:17 am on 1 November 2026 Permalink |
import istr def is_sum_of_two_primes(n): return any(i.is_prime() and (n - i).is_prime() for i in istr.range(2, n // 2 + 1)) def is_difference_of_two_squares(n): return n % 4 != 2 def has_two_properties(locker_number): return ( sum(is_sum_of_two_primes(x) for x in istr.permutations(locker_number, join=True)) == 6 and sum(is_difference_of_two_squares(x) for x in istr.permutations(locker_number, join=True)) == 4 ) for my_locker_number in istr.range(102, 401, 3): if has_two_properties(my_locker_number) and has_two_properties(my_locker_number - 1): print("my locker number is", my_locker_number)LikeLike
Ruud van der Ham 9:49 am on 1 November 2026 Permalink |
This works because an integer can be expressed as a difference of two integer squares if and only if its remainder when divided by 4 is not 2.
LikeLike