Enigmatic Code

Programming Enigma Puzzles

Enigma 1023: Semi-prime progressions

From New Scientist #2179, 27th March 1999

Harry and Tom have been investigating sequences of positive integers that form arithmetic progressions where each member of the sequence is the product of two different prime numbers and no members of the sequence have any factors in common. Harry has found the sequence of four such integers whose final (largest) member is the smallest possible for the final member of such a sequence; Tom has found the sequence of five such integers whose final (largest) member is the smallest possible for the final member of such a sequence.

What are the smallest and largest integers in:

(1) Harry’s sequence,
(2) Tom’s sequence.


Puzzle 29: Division (letters for digits)

From New Scientist #1080, 1st December 1977 [link]

In the following division sum each letter stands for a different digit:

Rewrite the sum with the letters replaced by digits.


Teaser 2779: New Year Party

From The Sunday Times, 27th December 2015 [link]

We have a game planned for our forthcoming New Year party. Each person there will write their name on a slip of paper and the slips will be shuffled and one given to each person. If anyone gets their own slip, then all the slips will be collected up and we shall start again. When everyone has been given a name different from their own, each person will use their right hand to hold the left hand of the person named on their slip. We hope that everyone will then be forming one circle ready to sing Auld Lang Syne — but there’s a slightly less than evens chance of this happening.

How many people will there be at the party?


Enigma 487: It still is one

From New Scientist #1638, 12th November 1988 [link]

I’ve just been sorting out some old papers and I’ve come across the fill set of football results from our local league of four teams for their 1958/59 season. They each played each other once and they used to get two points for a win and one for a draw. I had started to set a puzzle based on those results. I was going to include the partially filled in table below from the end of the season, but with digits replaced by letters (different digits being consistently replaced by different letters). I would then give some additional clues (including the fact that one of the games was won by a margin of five goals) to enable the puzzler to work out all the scores. (The team order is alphabetical, not in order of merit).

Enigma 487

I’ve now decided to see if the same cryptic table is still the basis of an Enigma based on the same set of football results but with three points for a win and one for a draw. It still is one, but I note that had the new point system been in force the 1958/59 champions (who were decided by better goal difference) would in fact only have been runners-up.

Find all six scores (for example, A5 B4; A3 C5; and so on).

I’m sure the name of the third team is meant to be Crumblies, so I’ve changed it. It doesn’t affect the outcome of the puzzle.


Enigma 1024: Regal progress

From New Scientist #2180, 3rd April 1999

George is whiling away some time contemplating a chessboard. He has placed a King in the bottom left square and proposes to transfer it by a sequence of moves to the top right square. A King can, of course, move only one square at a time, either horizontally vertically or diagonally. In order to keep this process finite, however, George has decided to allow only three different moves — one square forward (upward), one square to the right, or one square diagonally up-right.

Even with this restriction, there are many ways of transferring the King to the diagonally opposite corner. It could proceed up the left-hand side then across the top. Or along the bottom then up the right-hand side. Or diagonally straight across the middle. Or any one of a myriad of zig-zag routes.

George’s attempts to identify all possible routes were witnessed by his small son.

“There must be thousands of ways of getting there, dad.”

“No, son, there can only be a few dozen.”

Who is right — and exactly how many different routes are there?


Tantalizer 436: Rhyme and reason

From New Scientist #987, 12th February 1976 [link]

The poems of Prudence Meek are for all estates and conditions of men. They can be bought bound in velvet or in rags, printed in silver or in grey, scented with myrrh or with soap.

“Selling like hot cakes?” she was asked recently on a radio chat show.

“Verily”, she replied, “27 bound in velvet, 29 printed in silver, 34 scented with myrrh in less than a week. Half those scented with myrrh were printed in silver”.

“How about those scented with soap?”

“Three were not only printed in silver but also bound in velvet.”

“And total sales?”

“57”, the poetess confessed coyly, “but I’ll have you know that I had sold more luxury editions (the sort with velvet, silver and myrrh) than the total sales of Beverley Bunion’s disgusting odes”.

Knowing Bunion’s sales figure, the interviewer could then announce Miss Meek’s score in luxury editions.

What is it?

I’ve marked this puzzle as “flawed”, as, although it is possible to solve it and get a unique answer, the answer I found was different from the published solution. So it seems the setter had a different puzzle in mind.


Enigma 486: Number please

From New Scientist #1637, 5th November 1988 [link]

“I didn’t realise that telephone calls in the principality of Tarizania were so costly,” said Tom to George. “My bill for last month came to 100 zorinds for only 25 calls.”

“You spend a lot of time on all your calls,” observed George.

“I know — but the cost is independent of a call’s duration,” countered Tom. “Off-peak rates are two or five zorinds for local or trunk calls — and the corresponding charges at peak times are three or seven zorinds.”

“It sounds as though you were making trunk calls at the peak times,” remarked George.

“No; I made at least one call at all four rates. Admittedly I made more off-peak trunk calls than local ones at peak times.”

“How many calls did you make at each rate?”

“If you knew the one-digit number I made at the cheapest rate, you might find it interesting to work that out.”

How many three-zorind calls did he make?

Enigma 995 was also called “Number please”.


Enigma 1025: A score or more

From New Scientist #2181, 10th April 1999

We have a word game a bit like Scrabble. Each player is given a selection of letters with which to make words. Each letter of the alphabet is consistently worth a non-zero single-digit number and if you make a word you work out the word-score by adding up the value of the letters in the word.

In this way, for example, ELEVEN has a different word-score from TWELVE. In fact if you work out the word-scores of ONE, TWO, THREE, NINE, TEN and THIRTEEN you find that each is equal to that of either ELEVEN or TWELVE.

Which of them is (or are) equal to ELEVEN?


Puzzle 30: Football – new method (3 teams)

From New Scientist #1081, 8th December 1977 [link]

A new method to encourage goals in football matches has been suggested. In this method 10 points are awarded for a win, five points for a draw and one point for each goal scored whatever the result of a match.

3 teams, A, B and C are all to play each other once. After some, or perhaps all, of the matches have been played the points were as follows:

A   3
B   7
C  21

Not more than 7 goals were scored in any match.

What was the score in each match?


Enigma 485: A digital question

From New Scientist #1636, 29th October 1988 [link]

“0234 871956?” remarked Telephonopoulos on hearing Ms Omnidigitalis’s telephone number. “Why, it contains all the 10 digits once and once only.”

“That’s not all that’s interesting about it,” she replied. “It’s divisible by 11 without remainder. That’s if you agree to treat it as being the same number as 234,871,956: that is, to discount the initial zero.”

“There must be quite a few numbers consisting of 10 digits, none of them repeated within the same number, which are divisible by 11 without remainder.”

Exactly how many are there if:

(a) They are not constrained to begin with 0?
(b) They are constrained not to begin with 0?


Enigma 1026: Dualities

From New Scientist #2182, 17th April 1999


1. A prime which is also a square reversed. The first two digits form a square, and the last two a prime. The 1st, 3rd and 5th digits are all the same.
4. The square root of 7 across.
5. A palindromic square.
6. The square root of the reverse of 2 down.
7. A square which is prime when reversed.


1. A prime which is also a square reversed. The first three digits form a square which is also a square when reversed. The last two digits form a prime which is also a prime when reversed.
2. A prime which is also a square when reversed. All the digits are different. The first three digits form a square which is also a square when reversed: and the last digit is the same as that of 1 down.
3. A square which is a prime when reversed.

Find the answers for 1 across, 1 down, 3 down and 7 across.


Tantalizer 437: Miniatures

From New Scientist #988, 19th February 1976 [link]

When Pestle arrived at Mortar’s house last night for their weekly game of chess, he had forgotten to bring the pieces. Unsmilingly Mortar produces a board and a supply of Brandy, Gin, Kirsch, Rum, Vodka and Whisky in miniature bottles. Captures having been drunk, the game declined in quality, finally reaching this position. But Mortar had the harder head as well as the white pieces and delivered mate on the move.

The black circled pieces are black (white ones having had their tops removed at the start of play) and each kind of piece was represented by a different drink. Whenever a Vodka threatened a Gin, the Gin also threatened the Vodka. Whenever a Brandy threatened a Whisky, the Whiskey did not threaten the Brandy. Whenever a Kirsch did not threaten a Rum, the Rum did not threaten the Kirsch.

What was Mortar’s mating move?


Enigma 484: Who knows?

From New Scientist #1635, 22nd October 1988 [link]

There were 10 candidates A, B, C, …, J for an examination consisting of six multiple-choice questions P, Q, …, U. For each question there were five choices numbered 1 to 5 and just one choice was correct. The candidates’ answers are given in the following table:

Enigma 484

Three logicians, X, Y, Z, were shown the table and told that one candidate had got all six questions correct.

X was told the answer to P and asked if she knew the answer to Q. Y was told X’s answer and also the answer to R, and asked if she knew the answer to S. Z was told Y’s answer and also the answer to T, and asked if she knew the answer to U.

If I told you Z’s answer then you could choose one of the six questions so that, if I told you its answer, then you could tell me which candidate got all six questions correct.

What was Z’s answer?

Which question would you want to know the answer to?

If I told you the answer to your chosen question was 1, which candidate would you tell me got all six questions correct?


Enigma 1027: Five-digit cubes

From New Scientist #2183, 24th April 1999

Harry, Tom and I were asked by Mary each to select a five-digit perfect cube that consisted of five different digits and to tell her (in secret) which one had been selected. After we had each done so she said:

“If I now told any one of you individually how many digits his cube has in common with each of the other two cubes he could deduce with certainty one, but not both of them”.

That in itself was enough information to enable me to deduce with certainty both the cubes that Harry and Tom had between them selected.

What were those two cubes?

In the magazine this puzzle was published as Enigma 1026 (despite that number having been used the previous week).


Puzzle 31: Division. Figures all wrong

From New Scientist #1082, 15th December 1977 [link]

In the following, obviously incorrect, division sum the pattern is correct, but every single figure is wrong.


Find the correct figures. (The correct division comes out exactly. All the digits in the answer are only 1 out, but all the other digits may be incorrect my any amount).


Enigma 483: Undigital … Unfathomable?

From New Scientist #1634, 15th October 1988 [link]

Below is an addition sum with letters substituted for digits. The same letter stands for the same digit wherever it appears and different letters stand for different digits.

Enigma 483

Write the sum out with numbers substituted for letters.


Enigma 1028: A perfect pass

From New Scientist #2184, 1st May 1999

This is part of a football pitch; C is a corner, CE is a goal-line, CD is a side-line and AB is a side of the penalty area. Rovers have been awarded an indirect free-kick at the point F on AB and the ball is placed at F. Two players, Fay and Patricia, got to G on CD to discuss their plan. Then together they set off running, Fay towards F and Patricia towards P, each at a steady speed. After 10 seconds Fay reaches F and Patricia reaches P. Fay immediately takes the free-kick and kicks the ball along FA, so that it travels at a steady speed. Patricia carries on running at the same speed and in the same straight line. At the moment Patricia reaches AF, the ball reaches Patricia. Our problem is to find the speed of the ball, as follows:

Draw a line which passes through two of the labelled points, A, B, C, … Select a point where your line crosses an existing line and mark it X. Select a labelled point and mark it Y. You are to do this so that the distance between X and Y is the distance the ball travels in 10 seconds.

Which to labelled points should you choose to draw the line through? Which point is Y?




Tantalizer 438: Spring collection

From New Scientist #989, 26th February 1976 [link]

The task of collecting funds for the Red Cross in our little town falls on five married couples. Each spring they make a sort of race of it. The last occasion was very exciting. The couples all started on a different day but, having started, kept at it until the last Friday in March. Each collected the same amount each day but the amount in question was different for each couple.

A different couple was in the lead at nightfall on the final Monday, Tuesday, Wednesday, Thursday and Friday. In other words, each couple led once in the final week. At the close on Friday, Pamela and Albert held the position held by Edward and his wife on Monday night. At the close on Friday Queenie and Bill held the position held by Desmond and wife on Monday night. Similarly Rose and husband finished where Charlie and wife had been on Monday night and Sue and husband finished where Bill and Queenie had been on Monday night. Sue and husband were in the lead on Tuesday night. Queenie and Bill overtook Tania and husband during the final week. All couples had collected something by Monday nightfall.

What was the order at close of play?


Enigma 482: Hopscotch

From New Scientist #1633, 8th October 1988 [link]

Enigma 482

I remember playing a version of hopscotch when I was a child. We used a chalked outline like the one shown, and there were various games we could play on it. The simplest one was to start where shown and throw a pebble towards number 1 and then hop to the pebble: then throw it towards number 2 and hop to it, and so on, finally throwing the pebble towards number 9 and hopping to the pebble. You scored 1 if the pebble landed on the correct number, ½ if it missed by one, ⅓ if it missed it by two, and so on, making 9 the maximum possible total score. You were disqualified if the pebble didn’t land on a numbered square.

When I first tried the game I was pretty hopeless. When throwing at number 1 the pebble went past it. I hopped to the pebble, threw the pebble towards number 2, and continued in this way to complete the game. On no occasion was I standing on the square which I should be aiming at and, apart from when the pebble went past number 1 on my first throw, on only one other occasion did the pebble go too far and go past the square I was aiming at. I ended up with the pebble landing on all the squares from 1 to 9 (albeit in the wrong order) and my score was a whole number.

In what order did I visit the squares?

The issue date of New Scientist that this puzzle was published in falls on a Saturday, the issue date of previous magazines fell on a Thursday, so the date of this issue is 9 days after the date of the previous issue.


Enigma 1029: Chancelot

From New Scientist #2185, 8th May 1999

The company Chancelot has been asked to set up a lottery for a foreign country. It will work a bit like Britain’s own lottery with participants choosing some numbers: then the winning numbers will be decided by the company choosing some numbered balls at random.

The government has laid down some strict guidelines:

1. It wants participants to have to choose six numbers from 1, 2, …, N, where the top number N has not yet been decided. Then six of the numbered balls will be chosen and the winner’s choices must match all six.

2. It believes that the public is always suspicious when the winning selection includes two consecutive numbers. Therefore of all the combinations of six numbers from the N, it wants more than half of them not to include two consecutive numbers.

3. To give the public a fair chance of winning, it wants N to be the lowest possible satisfying the above conditions.

How many balls will there be in Chancelot’s lottery?


%d bloggers like this: