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 6:33 am on 22 November 2026 Permalink |
Very straightforward.
This Python program runs in 68ms. (Internal runtime is 164µs).
from enigma import (powers, irange, inf, group, mod, singleton, printf) # generate candidate PINs def pins(): # consider squares up to 4-digits for n in powers(0, inf, 2): if n > 9999: break # how many of the divisors give a remainder of 1? k = sum(1 for d in irange(2, 9) if n % d == 1) if k == 7: yield n # group candidate PINs by the final digit g = group(pins(), by=mod(10)) # look for categories with only 1 entry for (k, ns) in g.items(): n = singleton(ns) if n is not None: printf("final digit {k} -> PIN = {n:04d}")Solution: [To Be Revealed]
The setter does not want to reveal the PIN, but telling us that the final digit would reveal the PIN does reveal it!
LikeLike
Frits 8:34 am on 22 November 2026 Permalink |
Assuming that a 4-digit PIN doesn’t start with a zero.
def check(n): c = 0 for i in range(2, 10): c += ((n % i) != 1) if c > 2: return False return (c == 1) # odd 4-digit squares sqs = [i * i for i in range(33, 100, 2)] # candidate PINs cands = [n for n in sqs if check(n)] # dictionary of candidates per odd last digit d = {i: [n for n in cands if n % 10 == i] for i in range(1, 10, 2)} print(f"answer: {' or '.join(str(ns[0]) for ns in d.values() if len(ns) == 1)}")LikeLike
Jim Randell 8:40 am on 22 November 2026 Permalink |
@Frits: I think it is allowable for a PIN to have leading zeros.
LikeLike
ruudvanderham 1:01 pm on 22 November 2026 Permalink |
Note that this code requires istr >= 1.2.2
import istr import collections collect = collections.defaultdict(list) for pin in istr.squares(length=4, leading_zeroes=True): if sum(pin % j == 1 for j in range(2, 10)) == 7: collect[pin[-1]].append(pin) for last_digit, pins in collect.items(): if len(pins) == 1: print(pins[0])LikeLike