## Brainteaser 1659: Prime cuts

**From The Sunday Times, 26th June 1994** [link]

My new season ticket number is a prime obtained by rearranging five consecutive digits. By cutting off successive single digits from alternate ends I can steadily reduce this to a four-figure prime, a three-figure prime, a two-figure prime and finally a one-figure prime.

You too can use some short cuts to find my season ticket number.

This puzzle was included in the book *Brainteasers* (2002, edited by Victor Bryant).

[teaser1659]

## Jim Randell 9:48 am

on20 August 2019 Permalink |If we denote the 5-digit number

ABCDE, then we can see that all of(C, BCD, ABCDE)must be prime.And depending on whether we start truncating on the left or the right one of

(CD, BCDE)or(BC, ABCD)must be prime.We can write these conditions as a set of alphametic constraints and use the general alphametic solver [[

`SubstitutedExpression()`

]] from theenigma.pylibrary to solve them.This run file executes in 146ms.

Run:[ @repl.it ]Solution:The ticket number is 68597.It is composed from the digits 5, 6, 7, 8, 9, and can be truncated to give the following primes: 68597, 8597, 859, 59, 5.

LikeLike

## GeoffR 12:47 pm

on20 August 2019 Permalink |LikeLike