Teaser 2547: Multiple celebration
From The Sunday Times, 17th July 2011 [link] [link]
Today is my birthday and the birthday of my granddaughter Imogen. My age today is a whole-number multiple of hers, and this has been true on one third of our joint anniversaries.
If we both live until I am six times her current age, then my age will be a multiple of hers on two more birthdays.
How old are we today?
[teaser2547]


Jim Randell 8:27 am on 8 April 2025 Permalink |
This Python program runs in 63ms. (Internal runtime is 139µs).
from enigma import (irange, is_divisor, printf) # find multiple anniversaries for [a, b] and [a+d, b+d] def multiples(d, a, b): for x in irange(a, b): y = x + d if is_divisor(y, x): yield (x, y) # consider possible ages for the granddaughter (must be a multiple of 3) for g in irange(3, 20, step=3): # consider the setters age (a multiple of g, less than 6g) for k in [2, 3, 4, 5]: s = k * g # calculate earlier multiples d = s - g ms = list(multiples(d, 1, g)) # exactly 1/3 of the joint anniversaries so far are multiples if not (len(ms) * 3 == g): continue # and in there future there will be 2 more multiple anniversaries ms_ = list(multiples(d, g + 1, 6 * g - d)) if not (len(ms_) == 2): continue # output solution printf("g={g} s={s} [k={k} d={d}] -> {ms} {ms_}")Solution: The setter is 72. The granddaughter is 18.
So the age difference is 54 years.
The multiples in the past are:
Which is 6 anniversaries out of 18, so one third of them are multiples.
In the future (with the setters age up to 6 × 18 = 108) we can have the following multiples:
LikeLike