## Teaser 2898: My valentine

**From The Sunday Times, 8th April 2018** [link]

Using only positive digits,

MILLYwrote down a two-digit number and a nine-digit number, both numbers being divisible by 14.Splitting her nine-digit number into three three-digit numbers, she noticed that all three numbers were also divisible by 14.

Systematically replacing different digits by different letters, her two-digit number and nine-digit number ended up as

MY VALENTINE.What number is represented by

MILLY?

[teaser2898]

## Jim Randell 10:06 am

on19 July 2019 Permalink |This puzzle can be solved directly using the [[

`SubstitutedExpression()`

]] solver from theenigma.pylibrary.The following run file executes in 131ms.

Run:[ @repl.it ]Solution:MILLY = 17224.LikeLike

## GeoffR 10:46 am

on20 July 2019 Permalink |Gave up using Geocode Solver after three minutes but Chuffed Solver produced a solution in a reasonable time.

@Jim: Any idea why solvers run-times can vary so much?

LikeLike

## Jim Randell 11:10 am

on23 July 2019 Permalink |@GeoffR: Using integer literals for the powers of 10 instead of [[

`pow()`

]] seems to make the model acceptable to the [[`gecode`

]] solver.LikeLike

## GeoffR 12:20 pm

on23 July 2019 Permalink |@Jim: Thanks for the reply, yes that suggestion now works OK for the Geoode solver. Perhaps the Chuffed solver works better for powers as it looks as though it is based on C++

LikeLike

## Jim Randell 1:16 pm

on23 July 2019 Permalink |I suspect that one of the solvers notices that they are constant terms and calculates them once, but the other one doesn’t and keeps re-evaluating them.

LikeLike