Enigmatic Code

Programming Enigma Puzzles

Enigma 1214: A card trick

From New Scientist #2369, 23rd November 2002

Recently I went to a performance by the magicians Amber and Frances. The stage was divided in two by a screen; Amber sat at one side of the screen and could not see what happened on the other side, where Frances was sitting.

A member of the audience came out and Frances gave him a pack of cards that were numbered 1, 2, 3, … to a number I cannot remember. The man selected five cards from the pack and placed them on a stand so that the audience could see them. Frances pointed to one of the five cards and the man took it to Amber. This pointing and taking happened three more times. Amber then announced what the remaining card on the stand was. Afterwards the magicians said that if there had been just one more card in the park then they would not have been able to do the trick.

How many cards were there in the pack in the performance?

Enigma 298: Suspended sentences

From New Scientist #1446, 7th March 1985 [link]

Before settling down to serious business under the roof of “The Ark and Ant”, Eddie pushed aside his pint of Smollett’s Best and announced to his stalwart companions, Wilf and Stan, that he was going to give them a puzzle.

“Try completing this next sentence”, he said. “In this sentence, the number of occurrences of the number 1 is ____”.

After a couple of false starts, Wilf came up with “Not 1″.

“Okay, Einstein”, said Eddie, “if that was so easy, try completing this one, given that you can only fill the gaps with numbers”. He took out a scrap of paper and wrote:

“In this sentence, the number of occurrences of the number 0 is ___, of 1 is ___, of 2 is ___, …” and so on, with a list of consecutive integers.

To keep Stan occupied, he wrote out exactly the same sentence for him, except that it started at 1 and not 0.

Whether Wilf and Stand ever solved their respective sentences before the Smollett’s took its toll is frankly of little concern to me. However, had they done so, it is possible that in their two sentences, the number of 4s could have differed with the number of 5s being the same.

What complete sentence should Stan have produced?

Enigma 1215: One and a bit

From New Scientist #2370, 30th November 2002

Brits who venture into Euroland quickly discover that you get one-and-a-bit euros for every pound. I can reveal that the “bit” varies between one-third and three-eighths because:

(a) EURO × 1 ⅓ = POUND
(b) EURO × 1 ⅜ = POUND

These two sums are entirely distinct: any letter may or may not have the same value in one sum as in the other. But within each sum digits have been consistently represented by capital letters, different letters being used for different digits. No number starts with a zero.

Find the 5-digit numbers represented by POUND in (a) and (b).

Enigma 297: Division problem

From New Scientist #1445, 28th February 1985 [link]

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

Enigma 297

Find the correct sum.

Enigma 1216: Chain of primes

From New Scientist #2371, 7th December 2002

I have constructed a chain of ten 2-digit prime numbers. The ten primes that I have used are all different and except in the case of the first prime in the chain each prime’s first digit is the same as the previous prime’s second digit. In addition the fourth prime is the reverse of the first prime, and the tenth prime is the reverse of the seventh prime.

What (in this order) are the third, sixth and ninth primes in this chain?

Enigma 296: Quite a coincidence

From New Scientist #1444, 21st February 1985 [link]

I had a noon appointment in town and decided after a leisurely breakfast to get an appropriate train for the precisely 19 mile rail journey.

As the train drew out of the station I noticed on my very accurate watch that the departure was exactly on time.

As we arrived at the London terminus I noticed that the hour and minute hands on my watch were exactly coincident. I calculated that the train have averaged a whole number of miles per hour for my journey.

What time did the train depart and what was its average speed?

Enigma 1217: A league of their own

From New Scientist #2372, 14th December 2002

Four pubs recently played a round-robin football tournament, in which each team played each of the others twice — home and away. George has drawn up the final league table, using this grid.

Enigma 1217

With two points for a win and one for a draw, the teams finished, coincidentally, in alphabetical order, as shown. George found further surprises:

1. The four columns in the table — Won, Drawn, Lost, Points — each contained four different numbers;
2. Although Fagan’s won the tournament, the George won more games;
3. There were more away wins than home wins.

Which matches were drawn? Identify each as “X v. Y”, naming the home team first.

Enigma 295: The max-multiple game

From New Scientist #1443, 14th February 1985 [link]

This is a game between you and the Angel. It starts with the natural numbers from 1 to N, written in a row. You and the Angel play alternately, you first. The rules are:

(a) You take any number you choose (subject to D below) from those remaining in the row, and delete it from the row.
(b) The Angel deletes from the numbers remaining in the row all these which are multiples of the number you just took.
(c) Go to (a).
(d) You can never take a number which has no multiple remaining in the row; that is, your take must permit the Angel in his turn to delete at least one number.

The games stops when you can legally take no more numbers, and you want the sum S of all the numbers you have take to be as large as possible.

Enigma 295

The picture records a game with N=9 and S=8. You could have done better. Now try with N=35. How large can you make S?

Also, today is (Spoiler Alert!) Cheryl’s Birthday!

Enigma 1218: Discerning the truth

From New Scientist #2374/#2375, 21st/28th December 2002

When the three wise men were following the star they played a number game. Melchior would secretly select one of the 24 possible orders of the operations +, −, ×, ÷ (for example, he might choose ×, −, ÷, +). He would then select two positive whole numbers, p and q, and use his operations in the chosen order to work out: A = p*q; B = q*A; C = A*B; D = B*C.

So, for example, with a chosen order of ×, −, ÷, + and with selected numbers of p = 3, q = 2 he would calculate: A = 3×2 = 6; B = 2−6 = −4; C = 6÷(−4) = −1.5; D = (−4)+(−1.5) = −5.5.

He was only allowed to select p and q so that he did not find he was trying to divide by 0 during the calculation. Finally he would tell Caspar and Balthazar p, q and D and they would try to work out which of the 24 orders he had used.

The wise men said an order was “discernible” if, which ever p and q Melchior chose to use with that order, Caspar and Balthazar could work out that he had used that order. On their journey home the three wise men passed the time trying to discern the truth about the baby they had seen in the stable.

Question: Which of the following orders are discernible:

+ − × ÷,
− + × ÷,
− × ÷ +,
× ÷ + −,
÷ − × +?

Enigma 294: The Great and the Good

From New Scientist #1442, 7th February 1985 [link]

There are five possible chairman for the new Committee on Honary Degrees in Ancient Universities. All are on the secret list of the Great and the Good, where each has a secret score for Greatness and another for Goodness. All their scores are different but the exact figures have not yet been leaked to the newspapers.

Having seen the whole book, however, I can reveal that Sir Anthony Absolute is better than anyone greater than Dame Barbara Beveridge. Sir Charles Cumference is greater than all and only those better than Lady Dunstable. Lord Enterprise is less good than all and only those greater than Absolute. The least good of them is not also the least great.

The job, it has been decided, needs a good chairman. So please rank them in order of goodness.

Enigma 1219: Fare’s fair

From New Scientist #2374/2375, 21st/28th December 2002

I asked four experts what they were planning to eat for their Christmas lunch (main course and dessert). Their replies were:

Ainsley: “I’m having turkey. I’m not having Christmas pudding.”
Gary: “I’m having turkey. I’m not having Christmas pudding.”
Jamie: “I’m having turkey. I’m not having Christmas pudding.”
Rick: “Ainsley is having turkey. I’m not having Christmas pudding.”

That did not help much so I asked for some more information:

Ainsley: “Gary is having goose. Rick is having chocolate mousse.”
Gary: “Ainsley is having duck. Jamie is having mince pies.”
Jamie: “Rick is having salmon. Ainsley is having trifle.”
Rick: “Jamie is having turkey. Gary is not having mince pies.”

They are each planning to have a different one of those four main courses and a different one of those four desserts. At least one of the four experts told the truth throughout, at least one lied throughout, and the rest gave exactly one correct statement in each pair.

What is Rick planning to have for his Christmas lunch (main course and dessert)?

Enigma 293: Red is not a colour

From New Scientist #1441, 31st January 1985 [link]

Yesterday, a red letter day in our local club, was the occasion for the single-frame final of our annual snooker tournament. This climactic “Battle of the Titans” began with much canny safety play — but there were no scores until a stunning table-length red opened the balls to a useful break. The suspense mounted thereafter as successive visits to the table resulted in breaks which totalled just one point more than the (opponent’s) preceding break. I remember that all 15 red balls (scoring one point each) were potted singly, and every red was successfully followed by a nominated coloured ball. No penalty points were incurred and the frame was not ceded prematurely.

Once again, Roland Cannon took the winner’s cup. Rusty Abacus, our referee and official marker, gave a little presentation speech; referring to the recent final, he remarked that all the coloured balls potted in association with red balls had been potted the same number of times as the points value of the particular coloured ball. Then the blue ball (say) would have been potted five times in all.

Roland also won the medal for the highest break of the tournament. This was his reward for a gallant 22-point clearance which snatched the victory in his quarter-final battle.

Note that the potting sequence/points value of the coloured balls is: yellow/2, green/3, brown/4, blue/5, pink/6 and black/7 points. Also, the club rules committee insists that when a player has a lead of eight points or more after the final pink has been potted, then the final black ball must not be played.

What was Roland’s total score in that final frame?

Enigma 1220: Matchless days

From New Scientist #2376, 4th January 2003

Albion, Borough, City, Rangers and United are due to play another tournament in which each team will play each of the other teams once. One match will be played on each of 10 consecutive days.

Though the schedule of matches ensures that no team will ever play on two consecutive days United has complained that it has fewer matchless days between its first match and it last match than any of the other teams. Albion has the greatest number of matchless days between its first match and its last match, and Borough the second greatest number of matchless days between its first match and its last match. Rangers will play United one day before Albion play City.

On which of the days 1 to 10 will Borough play? And who will be Borough’s opponents on each of those days?

This puzzle completes the archive for 2003. There is a now full archive of the final 11 years of Enigma puzzles, from the start of 2003 to the end of 2013, as well as an archive from the start of Enigma in February 1979 to January 1985. In total there are currently 858 Enigma puzzles on the site.

Enigma 292: Soccer scores

From New Scientist #1440, 24th January 1985 [link]

Three football teams (AB and C) are to play each other once. After some — or perhaps all — of the matches had been played a table was drawn up giving some details for the matches played, won, lost and so on. But unfortunately not only had the digits been replaced by letters, but also one of the letters was wrong on one of the occasions on which it appeared — if it appeared more than once.

The table looked like this:

Enigma 292

(Two points are given for a win, and point to each side in a drawn match).

Which letter was wrong? What should it be? Find the score in each match.

Enigma 1221: Flower beds

From New Scientist #2377, 11th January 2003

Some time ago (Enigma 1112) George constructed a patio divided into seven rectangular zones of different shapes. He is now planning to divide his large square garden into seven rectangular flower beds. The beds are all different shapes, but all have the same area and cover the whole area of the garden with no gaps.

The width of the rose bed is exactly 25 feet. The side of the square garden is also a whole number of feet.

How many feet?

Enigma 291: An Enigma from the past

From New Scientist #1439, 17th January 1985 [link]

My old schoolteacher used to set us Enigma-type puzzles. For example, he once said the following:

“I have in mind a prime number between 4 and 50. I shall answer some questions about it and leave you to work out what the number is.”

We asked, “Is it one more than a multiple of 3?”

“Is it one, two or three more than a perfect square?” and “Is the sum of its digits odd?”

These he answered yes or no as appropriate and from his three answers we were able to work out the number.

In fact, now that I come to think about it, with all the above information the answer to the second question alone would be enough to enable you to work out the number.

What is it?

Enigma 1222: Magic sphere

From New Scientist #2378, 18th January 2003

Joe’s latest hobby is leather work. At the beginning of the soccer season he decided to make his own ball. This involved cutting out from a sheet of leather a number of  pentagons and hexagons (with all sides the same length). He carefully numbered each of the pentagons with consecutive odd numbers (1, 3, 5, …) and the hexagons with consecutive even numbers (2, 4, 6, …) and started to sew them together as instructed. Little did he realise that he would have to sew up 90 small seams.

When he eventually finished he was amazed to find that the sum of the number on any pentagon he chose plus the numbers on the adjacent hexagons came to the same total.

What was that total?

Enigma 290: Dice with a difference

From New Scientist #1438, 10th January 1985 [link]

Throwing two dice will give you a number from 2 to 12. Of course, some numbers are more likely that others. The probability of 2 for instance is 1/36; of 3 is 2/36; of 4 is 3/36; …; of 7 is 6/36; …; of 8 is 5/36; …; of 12 is 1/36.

That is true of two ordinary 6-sided dice, each bearing the letters of ENIGMA (which stand for the numbers one to six).

It is also true of this special pair of dice I have made — one with 9 sides bearing the letters IMAGINING, the other with 4 sides bearing the letters of GAGS. (S is a positive integer).

I’m not going to tell you how I constructed 9-sided and 4-sided dice. But I did, and they are fair dice. Can you interpret the MEANINGS of these fascinating facts?

Enigma 1223: Three sets to one

From New Scientist #2379, 25th January 2003

At tennis a set is won by the first player to win 6 games, except that if the score goes to 5 games all, the set if won either by 7 games to 5 or by 7 games to 6.

When I asked Tom the result of his match with Harry he replied that he had lost the first set but won the next three sets to take the match. When I asked him to tell me the score he told me that no two sets had the same score and at the end of each set the total number of games played up to that point was always a prime number; he also told me the total number of games played in the match, which enabled me to deduce with certainty the score in each individual set.

Give the score of each set in order in the form xy, with Tom’s score always first.

Enigma 289: All for one

From New Scientist #1437, 3rd January 1985 [link]

If the records in the 1926 mark book of class IVB of Henrietta High School are to be believed — and there are those who doubt their authenticity — then that year saw a set of examination results which must be unique for their sheer perversity. The performance of three of the 20 pupils (bearing the suspiciously coincidental names of Athos, Porthos and Aramis) are shown below.

Enigma 289

As you can see, the end-of-the-year exams consisted of three papers. The overall form positions were determined merely by adding the marks achieved in the three papers. On the face of it, Athos appears to have done better than average. Yet you will begin to see what is so odd about the results when I tell you that Athos actually came bottom of the class overall. Porthos, with results which would normally merit the comment “room for improvement”, was in fact top. Meanwhile, Aramis’s steady performance was reflected in his coming 12th overall. To add to the intrigue, I can tell you that Athos got 50 out of 100 in all three papers.

Information about the fourth member of the class “d’Artagnan”, is scant. However, I can tell you that his mark in Paper 2 was 2 higher (or was it 2 lower?) than Porthos’s, and that he came next to bottom in the class. Given that there were no ties at any stage from places in any list, how many marks did d’Artagnan get in Paper 1?


Get every new post delivered to your Inbox.