Enigmatic Code

Programming Enigma Puzzles

Tantalizer 456: Square deal

From New Scientist #1007, 1st July 1976 [link]

Feeling mortal, Lord Woburn summoned his daughters, Alice and Beatrice, to hear about his will. “I have decided to leave you my hippos”, he announced. “There are either 9 or 16 of them but you do not know which. Each of you will inherit at least one and I shell tell each of you privately how many the other will be getting”.

He was as good as his word. “How many shall I be getting?” Alice asked Beatrice nervously afterwards. Beatrice refused to say but asked, “How many shall I be getting?”. Alice refused to say and again asked, “How many shall I be getting?”. You should know that each lady is a perfect logician, who never asks a question she knows or can deduce the answer to.

I think this proves that a square deal on the hippopotonews is equal to the sum of the squaws on the other two sides. At any rate how many hippos was each to receive?

The puzzle as presented above is flawed, in that the situation described would not arise. An apology was published with Tantalizer 460.



Enigma 1067: Bye!

From New Scientist #2223, 29th January 2000

A number of players entered for a knockout tennis tournament. Some of them played in the first round games, the rest being given “byes” into the second round so that thereafter there were normal rounds in which all remaining players took part, leading eventually to quarter-finals, semi-finals and the final.

Overall the tournament took a week, with the same number of games being played each day.

Actually a whole-number percentage of the entrants were knocked out in the first round.

What percentage?


Enigma 442b: Oh yes I did! Oh no you didn’t!

From New Scientist #1592, 24th December 1987 [link]

After our successful pantomime production in which I played the leading lady, I gave my little costarring helpers some gifts from a big bag of different trinkets, and they each got a different number and none were left.

To make it fairer I gave each helper 10p for each gift that he didn’t get and deducted 40p for each gift that he did get, but that still gave each of them some 10p coins as well as some gifts. It cost me £12.60 in addition to the gifts.

What was the highest number of gifts received by any helper (that little fellow got less than 50p cash)?

What part was I playing?

This puzzle completes the archive of Enigma puzzles from 1987. There is now a complete archive from the start of Enigma in February 1979 to the end of 1987, and also from February 2000 to the final Enigma puzzle in December 2013. Making 1162 Enigma puzzles posted so far, which means there are about 626 left to post.

[enigma442b] [enigma442]

Puzzle 51: A multiplication

From New Scientist #1102, 11th May 1978 [link]

In the multiplication sum below digits have been replaced by letters. The same letter stands for the same digit wherever it appears, and different letters stand for different digits.

You are told that A is not greater than 5.

Find the digits for which the letters stand.


Enigma 1068: Triangular Fibonacci squares

From New Scientist #2224, 5th February 2000 [link]

Harry, Tom and I were trying to find a 3-digit perfect square, a 3-digit triangular number and a 3-digit Fibonacci number that between them used nine different digits. (Triangular numbers are those that fit the formula ½n(n+1); in the Fibonacci sequence the first two terms are 1 and 1, and every succeeding term is the sum of the previous two terms). We each found a valid solution and we each created a second valid solution by retaining two of the numbers of our first solution but changing the other one. Our six solutions were all different.

List in ascending order the numbers in the solution that none of us found.


Enigma 442a: Hark the herald angels sing

From New Scientist #1592, 24th December 1987 [link]

“Have a mince pie.”

“Thanks. How did the carol singing go this evening?”

“Very well indeed. There were 353 of us. We started from the village church at 6:00pm and arrived here at the hall some time ago. Have a look at this map here on the wall.

Enigma 442a

“We divided into groups and between us we covered every one of the 12 roads once. For each road, the group would enter at one end, sing the carols as they walked along the road, and leave at the other end. At each of the five junctions, all the groups due to arrive at that junction would come together and then re-divide before setting off again.”

“Did you sing many carols?”

“On each road, every member of the group would sing one verse as a solo. A verse takes one minute to sing.”

“Did people get cold waiting at the junctions for the other groups to join them?”

“No. That is the marvellous thing. We had divided into groups so that, at each junction, all the groups for that junction arrived at precisely the same time. Similarly, all the groups arrived at the hall at the same time.”

“You were very fortunate — a little miracle.”

“Don’t forget,” said the vicar who had been standing with us, “it is Christmas Eve.”

What time did the singers arrive at the hall and what was the total number of verses that they sang?

[enigma442a] [enigma442]

Tantalizer 457: Bee-lines

From New Scientist #1008, 8th July 1976 [link]

Now that Uncle Arthur can’t get about, he watches the world through a sunny little window in the sitting room. It is a diamond-shaped, mullioned window made up of 49 small diamond-shaped panes, separated by lead bars. Just below the window there is a bee hive and sleepy bees are often to be seen ambling up the glass. Uncle Arthur has noticed that they always move in a series of straight lines, passing through the middle of each pane, crossing from pane to pane at the mid point of a bar and moving in an upward direction.

He points out that there are many possible routes a bee can take from bottom to top and would like to know exactly how many.


Enigma 1069: Time for elevenses

From New Scientist #2225, 12th February 2000 [link]

I have a cube. On each of its faces is a digit, the style of writing being rather like the display on a calculator. I hold the cube to look at one of its faces from the front and then, keeping the upper and lower faces horizontal, I swivel the cube around and note the digits which I see (all seemingly the right way up) and hence I read off a four-figure number which is divisible by eleven.

Now I repeat the process starting this time looking from the front at one of the faces which was horizontal in the previous manoeuvre. Once again I read off a four-figure number which is divisible by eleven.

Now I start again with the cube in exactly the same position as it was at the start of the first process. This time I keep the left-hand and right-hand faces vertical and I swivel the cube around. Once again I read a four-figure number which is divisible by eleven and also by three odd integers less than eleven.

What was that last four figure number?


Enigma 441: The coloured painting

From New Scientist #1591, 17th December 1987 [link]

I looked down at the body slumped over my desk. One hand held my card “Newton Harlowe — Private detective”, and the other a painting. All I knew about painting came from watching my secretary Velda doing her nails. However, I could see in the dim light that is was a 6 × 6 array of small squares, each coloured red or blue or green. As the neon lights on the nightclubs opposite my office window flashed on and off and the light reflected from the wet sidewalks, I was able to make out the vertical columns of the painting. I saw:

though that was not necessarily the order they occurred in the painting. Suddenly the door opened and a raincoated figure with an automatic entered. There was a loud bang and everything went black.

I came round to find myself lying next to the body of a blonde on the floor of a living room. From the sound of the surf outside I could tell it was a beach-house. There on the wall was the painting. The moonlight shone onto it through the shutters. As they moved in the breeze I was able to make out the horizontal rows of the painting. I saw:

though again not necessarily in the right order. Just then a police siren sounded outside. I was going to have to do some explaining, and that painting was the key.

Reproduce the painting.


Puzzle 52: Football on the Island of Imperfection

From New Scientist #1103, 18th May 1978 [link]

There has been a great craze for football recently on the Island of Imperfection and I have been fortunate enough to get some details of games played there.

There are three tribes on the Island — the Pukkas, who always tell the truth; the Wotta-Woppas, who never tell the truth; and the Shilli-Shallas, who make statements which are alternately true and false, or false and true.

Three teams, one from each tribe, have been having a competition, in which eventually they will play each other [once] — or perhaps they have already done this. The secretaries of the three teams have been asked to give details of the number of matches played, won, lost and drawn and they do this in accordance with the rules of their tribe — so that, for example, all the figures given by the secretary of the Wotta-Woppa team will be wrong.

The figures given are as follows (calling the teams AB and C in no particular order):

(In no instance did a team win by a majority of more than three goals).

Find the tribe to which each of the three teams belong, and the score in each match.


Enigma 1070: Time to work

From New Scientist #2226, 19th February 2000 [link]

Amber cycles a distance of 8 miles to work each day, but she never leaves home before 0730h. She has found that if she sets off at x minutes before 0900h then the traffic is such that her average speed for the journey to work is (10 − x/10) miles per hour. On the other hand, if she sets off at x minutes after 0900h then her average speed is (10 + x/10) miles per hour.

(1) Find the time, to the nearest second, when Amber should set off in order to arrive at work at the earliest possible time.

Matthew lives in another town but he also cycles to work, setting off after 0730h, and he has found that his average speed for the journey to work follows exactly the same pattern as Amber’s. He has calculated that if he sets off at 0920h then he arrives at work earlier than if he sets off at any other time.

(2) How far does Matthew cycle to work?


Enigma 440: Three X

From New Scientist #1590, 10th December 1987 [link]

In the following division sum most of the digits are missing, but some are replaced by letters. The same letter stands for the same digit wherever it appears:

Find the correct sum.


Tantalizer 458: Knifemen

From New Scientist #1009, 15th July 1976 [link]

If you must have your operation at St. Vitus’ Hospital, choose your surgeon with care. There are four in residence and no two of them are equally safe. Here are six bits of information to cheer you up while you wait:

1. Cutaway is the most lethal.
2. Anyone safer than Borethrough is safer than Axehead.
3. Divot is not the safest.
4. Anyone safer than Divot is no less lethal than Cutaway.
5. Borethrough is not the safest.
6. Anyone safer than Axehead is safer than Divot.

Do I hear you complain that the six statements cannot all be true? Quite right — I put one false one in for diplomatic reasons. And now can you rank the butchers starting with the safest?


Enigma 1071: Special occasion

From New Scientist #2227, 26th February 2000 [link]

Your task this week is to find the day and date of my birthday this year in the form:

(for example, Monday / 8 / May).

If I told you the DAY and the NUMBER you could also work out the MONTH.

So now if I told you the first letter in the spelling of the MONTH you could work out the MONTH.

So now if I told you how many Es there are in the spelling of the MONTH you could work out the MONTH.

So now if I told you the NUMBER you could work out the DAY and MONTH.

What are the DAY, NUMBER and MONTH of my birthday this year?


Enigma 439: Ten to twenty

From New Scientist #1589, 3rd December 1987 [link]

“How many perfect squares are there between TEN and TWENTY?”


“Right. And are TWO, TEN, TWELVE and TWENTY even?”

“Of course. In fact the first and last digits of TWENTY are both even.”

“Right. And is TEN divisible by 3?”

“Of course not.”

In the above, digits have consistently been replaced by letters, different letters representing different digits.

Find NOW.


Tantalizer 459: Gardeners’ corner

From New Scientist #1010, 22nd July 1976 [link]

Our horticultural club had a little competition on Monday, with three events. For Vegetables you could enter either 1 cabbage or 2 turnips or 3 leeks or 4 potatoes; for Flowers either 2 hollyhocks or 4 lupins or 6 roses or 8 gladioli; for Fruit either 3 pears or 4 apples or 5 quinces or 6 strawberries. There were 5 competitors each of whom entered for two events.

Arthur Acorn displayed 12 items in all, Bill Barley 11, Crissie Canteloupe 9, Dahlia Dennis 6 and Edward Earthy 5. The prize for the entry judged best not only in its event but also in the whole show went to Crissie. She was in fact the only person to show that kind of item. You could deduce what it was, if I told you exactly what the other four competitors entered.

So what was it?


Enigma 1072: Into three piles

From New Scientist #2228, 4th March 2000 [link]

Sunny Bay fisherfolk have a tradition that when they return home with a catch of fish they take all the catch and divide it into three piles. Over the years they have pondered the question: given a particular number of fish, how many different ways can they be divided up? For example, they could divide up 10 fish in 8 ways, namely, (1, 1, 8), (1, 2, 7), (1, 3, 6), (1, 4, 5), (2, 2, 6), (2, 3, 5), (2, 4, 4) and (3, 3, 4).

One day the fisherfolk netted four large sea shells. On one side of each was one of the letters A, B, C and D and each shell carried a different letter. Each shell also had on its reverse one of the numbers 0, 1, 2, 3, 4, 5, 6, … The fisherfolk found that if they caught N fish then the number of different ways of dividing them into three piles was:

[(A × N × N) + (B × N) + C] / D

rounded to the nearest whole number. (Whatever the number of fish, the calculation would never result in a whole number plus a half; so there was no ambiguity about which whole number was the nearest).

I recall that D was less than 21, that is, the number on the reverse of the shell with D on it was less than 21. Also A and C were different.

What were A, B, C and D?


Enigma 438: Doubloons

From New Scientist #1588, 26th November 1987 [link]

Our gallant ship had been overrun by pirates just off Tortuga and their leader, the notorious Black Jake, was strutting about our decks among his jeering men tormenting the captives.

Black Jake swaggered through the smoke in my general direction. “They tell me you have a head for figures, landlubber,” he sneered, prodding me with a gnarled forefinger.

“Er yes,” I said, in what must have been one of my less distinguished utterances.

“Then solve this or walk the plank. In this purse I have doubloons and doubloons only; their number consists of four digits. If you double the number of doubloons and reverse the digits of the number so formed you obtain the same number of doubloons as there would be in the purse were you to add two doubloons to their number.”

By this time my head was swimming. But I knew that if I didn’t solve it on the double that worry would become a drop in the ocean.

How many doubloons were there in Black Jake’s purse?


Puzzle 53: Addition

From New Scientist #1104, 25th May 1978 [link]

In the following addition sum the digits have been replaced by letters. The same letter stands for the same digit wherever it appears and different letters stand for different digits.

Find the digits for which the letters stand.


Enigma 1073: Cross-country match

From New Scientist #2229, 11th March 2000 [link]

In cross-country matches, teams consist of six runners. The team scores are decided by adding together the finishing positions of the first four runners to finish in each team. The team with the lowest score is the winner. Individuals never tie for any position and neither do teams because if two teams have the same score the winner is the team with the better last scoring runner.

The fifth and sixth runners to finish in each team do not score. However if they finish ahead of scoring runners in another team they make they make the scoring positions of those scoring runners, and the corresponding team score, that much worse.

In a recent match between two teams, I  was a non-scorer in the winning team. Each team’s score was a prime number, and if I told you what each team’s score was you could deduce with certainty the individual positions of the runners in each team. I won’t tell you those scores, but if you knew my position you could, with the information given above, again deduce with certainty the individual positions of the runners in each team.

(1) What was my position?
(2) What were the positions of the scoring runners in my team?