Teaser 3026: Party time
From The Sunday Times, 20th September 2020 [link]
A four-digit number with different positive digits and with the number represented by its last two digits a multiple of the number represented by its first two digits, is called a PAR.
A pair of PARs is a PARTY if no digit is repeated and each PAR is a multiple of the missing positive digit.
I wrote down a PAR and challenged Sam to use it to make a PARTY. He was successful.
I then challenged Beth to use my PAR and the digits in Sam’s PAR to make a different PARTY. She too was successful.
What was my PAR?
[teaser3026]
Jim Randell 5:30 pm on 18 September 2020 Permalink |
This Python program uses the [[
SubstitutedExpression()
]] general alphametic solver from the enigma.py library to find possible PARTYs. It then collects pairs of PARs together and looks for a PAR that has two possible pairings that share the same digits.It runs in 56ms.
Run: [ @repl.it ]
Solution: Your PAR was 1785.
1785 can be paired with both 2496 and 4692 (missing digit = 3) to make a PARTY.
There are 7 possible PARTYs:
There are only 2 PARs that appear in more than one PARTY: 1785 and 2754. Each of these appears in two PARTYs, but only 1785 is paired with two other PARs that share the same digits.
LikeLike
Jim Randell 12:28 pm on 20 September 2020 Permalink |
Using the [[
SubstitutedExpression
]] general alphametic solver from the enigma.py library.This run file executes in 94ms.
LikeLike
Frits 9:12 pm on 19 September 2020 Permalink |
LikeLike
Will Harris 3:14 pm on 19 December 2020 Permalink |
Not much help now but wrote this for my coursework project using GNU prolog [ https://www.tutorialspoint.com/execute_prolog_online.php ]
LikeLike
Jim Randell 3:26 pm on 19 December 2020 Permalink |
@Will: Thanks for your comment.
I’m not sure if the code came through correctly (WordPress can get confused by text with < and > characters in it).
If it’s wrong, can you post again with the code in:
and I’ll fix it up.
LikeLike
GeoffR 4:57 pm on 16 December 2021 Permalink |
LikeLike