Brain-Teaser 467: [Registration numbers]
From The Sunday Times, 10th May 1970 [link]
There was a christening at our house last Sunday and there were three visitors’ cars in the drive.
The car registration numbers of these three cars (disregarding any letters) each a three-digit prime number and among these numbers each of the digits 1 to 9 was used once only.
This in itself was quite remarkable, but the sum of there three three-digit primes gave the three digit registration number of my own car.
What were the three registration numbers of the visitors’ cars?
This puzzle was originally published with no title.
[teaser467]
Jim Randell 7:49 am on 28 March 2019 Permalink |
We can use the [[
SubstitutedExpression()]] solver from the enigma.py library to solve this puzzle.This run-file executes in 82ms.
Solution: The registration numbers are: 149, 263, 587.
So, the setters registration number is 999.
LikeLike
GeoffR 4:00 pm on 28 March 2019 Permalink |
% A Solution in MiniZinc include "globals.mzn"; enum letters = {A, B, C, D, E, F, G, H, I}; array [letters] of var 1..9: v; constraint all_different (v); predicate is_prime(var int: x) = x > 1 /\ forall(i in 2..1 + ceil(sqrt(int2float(ub(x))))) ((i < x) -> (x mod i > 0)); var 100..999: ABC = 100*v[A] + 10*v[B] + v[C]; var 100..999: DEF = 100*v[D] + 10*v[E] + v[F]; var 100..999: GHI = 100*v[G] + 10*v[H] + v[I]; var 100..999: XYZ; % my car registration number constraint ABC + DEF + GHI == XYZ /\ GHI > DEF /\ DEF > ABC; constraint is_prime(ABC) /\ is_prime(DEF) /\ is_prime(GHI); solve satisfy; output[ "The three registration numbers of the visitors’ cars were " ++ show(ABC) ++ ", " ++ show(DEF) ++ " and " ++ show(GHI) ]; % The three registration numbers of the visitors’ cars were 149, 263 and 587LikeLike