Teaser 2509: [Lottery numbers]
From The Sunday Times, 24th October 2010 [link] [link]
I won £10 on the lotto with three correct numbers (in the range 1 to 49).
I then calculated the difference between two six-figure numbers: one formed by writing my three winning numbers in descending order; the other by writing them in ascending order. I multiplied this difference by three and divided the answer by the sum of my winning numbers. I then divided the new answer by one of my winning numbers. The answer was another of my three winning numbers.
What, in ascending order, were my three winning numbers?
This puzzle was originally published with no title.
This completes the archive of Teaser puzzles originally published in 2010. There is now a complete archive (with solutions) of puzzles from 2010 – 2025, as well as lots of earlier puzzles going back to the start of Sunday Times Teaser puzzles. I will continue to add new puzzles as time allows.
[teaser2509]
Jim Randell 8:49 am on 9 December 2025 Permalink |
Here is a solution using the [[
SubstitutedExpression]] solver from the enigma.py library.The following run file executes in 98ms. (Internal runtime of the generated code is 14ms).
#! python3 -m enigma -rr SubstitutedExpression # suppose the numbers are: AB CD EF (in order) --distinct="" --invalid="5|6|7|8|9,ACE" "A <= C" "C <= E" "0 < AB < CD < EF < 50" # the two 6-digit numbers are: ABCDEF, EFCDAB # and 3 times the difference divided by the sum of the original numbers # is the same as the product of two of the original numbers "div(abs(ABCDEF - EFCDAB) * 3, AB + CD + EF) in { AB * CD, AB * EF, CD * EF }" # [optional] tidy up output --template="(AB CD EF)" --solution="" --verbose="1-H"Solution: The three winning numbers were: 32, 33, 36.
These are assembled into the two 6-digit numbers:
And the dividing 3 times the difference of these by the sum of the original numbers gives:
And 1188 is the product of two of the original numbers:
LikeLike
Ruud 10:33 am on 9 December 2025 Permalink |
import istr for numbers in istr.combinations(range(1, 50), 3): n_descending = istr("").join(sorted(numbers, reverse=True)) n_ascending = istr("").join(numbers) n_difference = n_descending - n_ascending if (n_difference * 3).is_divisible_by(sum(numbers)) and any(n0 * n1 == n_difference * 3 / sum(numbers) for n0, n1 in istr.combinations(numbers, 2)): print(numbers)LikeLike
Frits 7:58 pm on 10 December 2025 Permalink |
The sum of the winning numbers must be 101.
See Teaser 2509
LikeLike
Jim Randell 10:24 am on 11 December 2025 Permalink |
This analysis allows a nice compact program:
# for numbers (x, y, z) we have: # # 3.9999.(z - x) = (x + y + z).{ x.y | x.z | y.z } # # 101 is a prime factor of 9999 that can only appear in (x + y + z) # and since (x + y + z) in [6, 144] it follows: # # (x + y + z) = 101 # # leaving: # # 3.99.(z - x) = { x.y | x.z | y.z } from enigma import (decompose, printf) for (x, y, z) in decompose(101, 3, increasing=1, sep=1, min_v=1, max_v=49): if 297 * (z - x) in { x * y, x * z, y * z }: printf("({x}, {y}, {z})")LikeLike