## 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 aPARTYif no digit is repeated and eachPARis a multiple of the missing positive digit.I wrote down a

PARand challenged Sam to use it to make aPARTY. He was successful.I then challenged Beth to use my

PARand the digits in Sam’sPARto make a differentPARTY. She too was successful.What was my

PAR?

[teaser3026]

## Jim Randell 5:30 pm

on18 September 2020 Permalink |This Python program uses the [[

`SubstitutedExpression()`

]] general alphametic solver from theenigma.pylibrary to find possiblePARTYs. It then collects pairs ofPARs together and looks for aPARthat has two possible pairings that share the same digits.It runs in 56ms.

Run:[ @repl.it ]Solution:YourPARwas 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 onePARTY: 1785 and 2754. Each of these appears in twoPARTYs, but only 1785 is paired with two otherPARs that share the same digits.LikeLike

## Jim Randell 12:28 pm

on20 September 2020 Permalink |Using the [[

`SubstitutedExpression`

]] general alphametic solver from theenigma.pylibrary.This run file executes in 94ms.

LikeLike

## Frits 9:12 pm

on19 September 2020 Permalink |LikeLike

## Will Harris 3:14 pm

on19 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

on19 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

on16 December 2021 Permalink |LikeLike