Enigmatic Code

Programming Enigma Puzzles

Tantalizer 390: Ask the family

From New Scientist #940, 13th March 1975 [link]

“Welcome to the advanced logic class, ladies. Only four of you? Never mind. I see from your forms that each of you has twins, making five boys and three girls in all. That suggests a little test, since none of you have ever met before. I shall first give each of you the form of one of the others. Look at it but don’t show it to the others. Now, Mrs Piper, having seen Mrs Queen’s form, can you deduce the sexes of both Mrs Round’s twins? No? That is quite correct. Mrs Queen, having see Mrs Round’s form, can you do both Mrs Snug’s twins? No? That is also correct. Mrs Round, having seen Mrs Snug’s form, can you do both Mrs Piper’s twins? No? Quite right. And Mrs Snug, having seen Mrs Piper’s form, can you do both Mrs Queen’s twins? No? Right again. No one, however good her logic and her hearing, was in a position to answer Yes. By the way, Mrs Queen, you and Mrs Snug have a different number of boys. Now then, which ladies have the girls?”


Enigma 561: Building sand castles

From New Scientist #1714, 28th April 1990 [link]

You can add a letter at a time to build up words from “A” to “CASTLE” in the following way:


Now I can substituted digits for letters in many ways, one being:

5 → 56 → 256 → 2576 → 25761 → 257631

in which there are numbers divisible by 2, by 3, by 5, … and in fact only the first number is prime.

Your task today is to find a different substitution of non-zero digits in that word-chain (as always different digits consistently replacing different letters) so that none of the resulting numbers is divisible by 2 or 3 or 5 — and in fact so that they are all prime and so that SANDS is prime too.

You don’t have to dig too hard — there are lots of short-cuts and, of course, there is an answer.

What is the value of CASTLE?


Puzzle #71: White lines

From New Scientist #3294, 8th August 2020 [link] [link]

There are 32 white squares on a chessboard. Your task is to draw a line that passes through all of the white squares only once, moving via the corners where they touch without lifting your pen off the board. The diagram shows the kind of line that is required. Start from any square you like. Can you get through all the squares with a single line? If not, then what is the smallest number of separate lines that you need?


Enigma 948: Losing time

From New Scientist #2103, 11th October 1997

The church clock has developed a serious fault. The escapement keeps perfect time, but a small widget in the mechanism has become loose and drops out of place whenever the hands reach an exact hour. When the hour and minute hands next come together while the widget is misplaced, they rewind instantaneously to the previous exact hour (unless they are showing 12 o’clock) and the widget drops back into its correct position. The clock then continues running at the correct rate, but showing the wrong time.

If the hands come together with the widget correctly placed, nothing untoward happens.

The verger set the clock correctly at midnight on New Year’s Eve, and the fault became apparent over an hour later. If left unattended, when would the clock next be running normally and showing the correct (12 hour) time?


Tantalizer 391: Tough luck

From New Scientist #941, 20th March 1975 [link]

“How did you get on, young Tommy?”

“We beat St. Olaf’s by 10 goals to 2 and scored 3 goals in each of our other four games, Uncle. Indeed we scored more goals than the other five sides got in all their games put together.”

“Splendid! Tell me more.”

“Well, the Priory beat St. Saviour’s, who drew with St. Olaf’s. Queen Anne’s drew fewer games than …”

“Never mind about Queen Anne’s. I want to know about your St. Trinian’s lot. Scoring was 2 points for a win and 1 for a draw, I presume. What about the final order?”

“There were no ties in it and we did worse than Rugmakers’.”

“Yes, yes, but where exactly did you come?”

“Bottom. Uncle.”

Can you reproduce the whole league table?


Enigma 560: Cuts in football

From New Scientist #1713, 21st April 1990 [link]

The football season is over and the following final table has been just published in the paper with a number in each of the 30 squares.

During the season each team had played each other once, with 1 point for a win and ½ point for a draw. The table showed everyone ended with a whole number of points. The editor has been able to order the teams according to their points except that goal difference was needed to put Albion above Victoria.

Unfortunately, Rovers have been found guilty of misconduct and as a result have had 1 Point, 2 Goals for, and 1 Goal against deducted from their actual figures. The actual figures were large enough for the subtractions to take place. The editor used the figures after the deductions to order the teams and to fill in the appropriate squares.

I have just cut the 5 × 6 array of numbers out of the table and cut it into 15 dominoes, each of 2 squares. Each domino has a pair of numbers on it and the 15 pairs are:

0-0, 0-1, 0-2, 0-3, 0-4, 1-1, 1-2, 1-3, 1-4, 2-2, 2-3, 2-4, 3-3, 3-4, 4-4.

The only other fact I can remember about the table was that the total number of drawn matches was less than the number of points obtained by Albion. However, the one match I saw during the season ended with Town beating Victoria.

Reconstruct the table and mark on it how I cut it into dominoes.


Puzzle #70: Taking the biscuit

From New Scientist #3293, 1st August 2020 [link] [link]

Alpha and Betty play a rather greedy game. There are eight digestive biscuits in one jar, and four rich tea biscuits in another. Each player can collect biscuits in one of two ways. They either:

• Take any number of biscuits from one jar, or;
• Take an equal number of biscuits from both jars.

The player who takes the last biscuit wins the game and gets to keep all the biscuits. Alpha is set to go first. What biscuit or biscuits should she take?


Enigma 949: Farm land

From New Scientist #2104, 18th October 1997

A retired farmer is selling his land to his neighbours, but retaining the farmhouse as his retirement home. The whole property forms a square, including the smaller square plot in the corner which contains the farmhouse and is not for sale. The three fields, labelled A, B and C are rectangular, all the same shape but different sizes. The farmer is asking the same price per acre for each. If he wants £10,000 for field B, how much does he expect for the three together?

This puzzle brings the total number of Enigma puzzles on the site to 1400. There are 392 puzzles remaining to post, and then the archive of Enigma puzzles will be complete.

There are also 90 puzzles from the Puzzle series (complete) and currently 109 puzzles from the Tantalizer series, bringing the total number of puzzles on Enigmatic Code to 1599 (there are also 64 puzzles from the new Puzzle # series, and few other miscellaneous puzzles, so the actual total is a bit more).

Together with the 322 Sunday Times Teaser puzzles on the S2T2 site this brings the total number of puzzles available between the two sites to about 1989, so we are close to having 2000 puzzles available!


Tantalizer 392: A question of authorship

From New Scientist #942, 27th March 1975 [link]

Under the spreading chestnut tree in the garden of St Jude’s college are reposing five professors of philosophy. Each is reading a stout volume written by a different one of the others. To be precise, Professor Aristotle wrote the work being read by the author of “Understanding Understanding”. Professor Baralipton is perusing the work by Professor Castellio’s uncle. Professor Descartes is deep in “Words of Wisdom”, which is dedicated to Professor Castellio. Professor Einstein is reading the book by the man reading the book by the man reading “Yesterday Was Tomorrow”. The author of “Zeno” is reading “Xenophilia as a Categorical Imperative”, written by the man reading the book by the man reading the book written by Professor Castellio.

Who wrote which of these milestones of philosophic progress?


Enigma 559: By Jingo!

From New Scientist #1712, 14th April 1990 [link]

The By Jingo! Cocoa Co (a subsidiary of the Cohen, Coe & Co) has marketed some very patriotic Easter eggs this year. The eggs are identical in size and shape (ovoidal: cylindrical symmetry about an axis with one end pointier than the other) and are covered with foil coloured in such a way that octants of equal area appear on the finished egg, symmetrically placed. (Imagine an equator running around the belly of the egg at right angles to its [polar] axis of symmetry in such a way that half the wrapping foil lay above and half below).

Each octant is either red, white or blue. Each egg has all three colours on it somewhere, but on no egg do octants sharing the same edge (adjacent octants) have the same colour. A box set of By Jingo! contains all distinguishable eggs coloured according to the above.

Next year eggs are to be coloured according to these same rules but will be ellipsoidal: instead of having a pointier and a flatter end as eggs do, one end of the egg will be indistinguishable from the other and the octants will be each the same size and shape. (This year, of course, although all octants have the same area the four octants near the pointier end are slightly different in shape from the four at the flatter end). A box set will contain all distinguishable eggs coloured according to the constraints already outline.

How many eggs will there bin in a By Jingo! box of eggs:

(a) this year?
(b) next year?


Puzzle #69: Cutting the flag

From New Scientist #3292, 25th July 2020 [link] [link]

I have a stripy flag laid out on my desk. The stripes are all of equal width, five of them in total. Because three of the five are blue, I know that three-fifths of the flag is blue. However, I take my scissors out and make two straight, angled cuts at both ends of the flag, one of them at about 45 degrees, the other almost straight across, leaving me with a stripy trapezium.

What fraction of this trapezium is blue? Is it more, less or the same as the three-fifths for the original flag?


Enigma 950: Turning, turning

From New Scientist #2105, 25th October 1997

Arrange 99 coins in a large circle. The operation that you carry out on the circle of coins has two stages. First, you go around the circle and note all the coins that lie between two coins that are the other way up, that is, all heads between two tails and all tails between two heads. Next, you turn over all the coins that you have noted.

You take the circle you have obtained from the operation and carry out the operation on that circle. Then you take the circle resulting from that operation and carry out the operation on it, and so you go on, successively carrying out the operation on the circle resulting from the previous operation.

A circle of coins is said to be stable it when you carry out the operation on it, it does not change.

Question 1: Is it possible to find a starting circle so that you can carry out the operation 48 times without ever reaching a stable circle?

Question 2: Is it possible to find a starting circle containing 49 heads and 50 tails so that if you successively carry out the operation then you will reach a stable circle, and you will reach it for the first time after precisely 48 operations?


Tantalizer 393: Og, Gog and Magog

From New Scientist #943, 3rd April 1975 [link]

Tom, Dick and Harry have the star parts in their school play this term. The plot concerns three giants, Og, who always speaks the truth, Gog, who never does, and Magog, who speaks as he pleases. Each boy has taken to living his own part, of course, and is driving us all mad.

Knowing only this much and seeking to discover which boy has which part, I asked Tom and Dick which part is Harry’s. They both gave the same answer. I also asked Dick and Harry which part Tom is playing and the both made the same reply. At this stage I did not have enough data from which to deduce exactly who had which part. So I asked Tom point blank which giant he is playing and was then able to deduce from his reply how all three parts have been assigned.

Can you work it out too?


Enigma 558: Simple arithmetic

From New Scientist #1711, 7th April 1990 [link]

As usual, in this letters-for-digits puzzle, each digit has been consistently replaced by a letter, with different letters standing for different digits. Firstly, I can tell you that:

and also that THREE is divisible by 3 (but not by 6) and that FOUR is divisible by 4 (but not by 8).

Find the value of SOON.


Puzzle #68: Diamonds

From New Scientist #3291, 18th July 2020 [link] [link]

“Once upon a time”, began Ivan the storyteller, with children at his feet, “there lived a queen called Factoria who had six daughters and many palaces. In each palace, she kept as many crystal vases as she had palaces, and in each vase were as many diamonds as there were vases in that palace. Then one day the Queen died, leaving a will: ‘I leave one vase of diamonds to my loyal servant Fidelio. The rest of the diamonds I will share equally between my daughters. Any remaining diamonds, Fidelio will put in this box'”.

Ivan reached into his pocket and pulled out a small wooden casket. “And this is the box!”

“How many diamonds are there?”, screamed the children.

“It you can tell me, I will give you the box”, said Ivan.

“But you haven’t told us how many palaces…” they cried.

Ivan winked.

How many diamonds are in the box? How can you be certain?


Enigma 951: City stay third

From New Scientist #2106, 1st November 1997

Albion, Borough, City, Rangers and United have once again been playing their tournament in which each team played each of the other teams once, two matches being played on each of five successive Saturdays, each team have one Saturday without a match.

Three points were awarded for a win and one point to each team for a draw; the position of teams that were equal on points at any stage was determined by their goal difference, calculated by subtracting goals conceded from goals scored. Teams were only regarded as tying if both their points and their goal differences were identical.

After the fourth Saturday’s matches, Albion were in the lead followed, in order, by Borough, City, Rangers and United; there were no ties at that stage. City had completed their matches and did not play on the fifth Saturday. After the fifth Saturday’s matches had been played City were still alone in third place, but now they were ahead of Albion and Borough but behind Rangers and United. I’ll leave it to you to discover whether the teams ahead of them and/or behind them were now tying.

No two matches in the tournament had the same score; no team scored more than three goals in any match; all five teams scored the same number of goals in the tournament.

Give the results and scores of Rangers’ matches in the tournament.


Tantalizer 394: Waste disposal

From New Scientist #944, 10th April 1975 [link]

Last Monday morning each of the Principals in the Ministry of Allocation and Distribution received a top secret memo, which cause him to pen forthwith a separate memo to each of his fellow Principals. At the end of the day the Senior Assistant Principal gathered all these memos together (including the original ones) and divided them carefully into tens, in readiness for shredding. Finding that he had some over, however, he hastily wrote a few extra top secret memos of his own, to make up the final ten. Then he fed all the bundles of ten through the shredder and went home, conscious of a job well done. He had in fact disposed of twice as many bundles as there are lamp-posts on his side of Whitehall.

How many memos did the gallant S.A.P. write himself?


Enigma 557: Ring a bell

From New Scientist #1710, 31st March 1990 [link]

I emerged from the jungle to find a clearing at the centre of which were two circles of stones, each looking as in the picture. One circle had a carved wooden lion at its centre and the other a carved wooden tiger.

As I watched a lion and a tiger walked towards the circles. The lion jumped onto a stone in the wooden-lion circle and the tiger onto a stone in the wooden-tiger circle. After a short time both animals simultaneously jumped to the next stone in their circle — going clockwise. After another short time both animals again jumped to the next stone. This continued until the tiger, in jumping, touched the rope stretched across between two stones and attached to a bell which rang as the rope was touched. The lion and the tiger then walked off into the jungle.

My guide explained that I was fortunate for that was the last day the ceremony would happen. It had taken place for 1600 days and on each day the starting position of the lion, or of the tiger, or of both, had been different. Each day the ceremony ended as soon as the lion or the tiger or both sounded one or two bells or gongs or a bell and a gong. For example, on 30 days the ceremony ended with two bells, on 10 days with two gongs, and on 20 days with a bell and a gong.

On how many days did the ceremony end with one bell?


Puzzle #67: My prime

From New Scientist #3290, 11th July 2020 [link] [link]

I am thinking of a two-digit prime number. The special thing about my prime, though, is that if I square its two digits, the difference between these square numbers is also prime.

As it happens, I haven’t given you enough information to identify my number. But whatever my number is, you can be certain that its two digits have a particular relationship to each other. What is that relationship?


Enigma 952: Back to the future

From New Scientist #2107, 8th November 1997

My digital clock works on the 12-hour system and always displays four digits (showing, for example, 02:15 at a quarter past two in the afternoon). When first plugged in it starts with the display 12:00. Strangely enough, when I first had the clock I didn’t know how to set the time so I plugged it in late one morning and just left it running. The clock was then an exact number of minutes fast, but for just one minute in each 12-hour session the four digits displayed were those of the correct time, but in reverse order.

At what time did I plug in the clock?


%d bloggers like this: