Enigmatic Code

Programming Enigma Puzzles

Enigma 380: Answer what?

From New Scientist #1529, 9th October 1986 [link]

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

enigma-380

Write the sum out with the letters replaced by digits.

[enigma380]

Tantalizer 493: Prize guys

From New Scientist #1044, 24th March 1977 [link]

I met Tom on his way back from the pet show looking pleased with himself. “Prize for my budgie, prize for my cat, prize for my dog”, he explained, “How did Dick and Harry do?”

“Don’t you know?” I asked.

“Not a thing.”

“They too got a prize each for each of a budgie, cat and dog. So you scooped all those nine prizes between you — no ties, incidentally. Dick’s lowest prize was for his budgie.”

“Oho,” exclaimed Tom after reflection, “so Harry did better with his cat than with his dog.”

He then listed all nine prizes correctly. Can you?

[tantalizer493]

Enigma 1132: Phone back

From New Scientist #2288, 28th April 2001

The PIN code on George’s cash card is a semi-prime number, that is to say it is the product of two different prime numbers. He discovered some time ago that the PIN code multiplied by his car registration number gives his six-digit phone number, which does not begin with a zero. But George has now discovered a slightly more obscure coincidence. If he subtracts his house number from his phone number and multiplies the result by his house number, the result is his phone number with its digits in reverse order!

What is George’s car registration number?

[enigma1132]

Enigma 379: Magic magic squares

From New Scientist #1528, 2nd October 1986 [link]

Enigma 379

Write, in words, different whole numbers in each of the other eight squares so that the sum of each row, column and corner-to-corner diagonal is the same. But do it in such a way that the number of letters in each of the nine squares is different and the total of letters in each row, column and corner-to-corner diagonal is the same.

What’s the highest number in the magic magic square?

[enigma379]

Puzzle 84: A cross number

From New Scientist #1136, 4th January 1979 [link]

Puzzle 84

Across:

1. The sum of the digits is 10.
3. Digits all even.
4. Digits all odd, and each one is less than one before.

Down:

1. The second digit is greater than either of the other two.
2. A multiple of 3 Down.
3. The second digit is greater than the first one.

(One of these numbers is the same as another one reversed and there are no 0s).

This completes the archive of New Scientist puzzles published in 1979.

[puzzle84]

Enigma 1133: Smile

From New Scientist #2289, 5th May 2001

enigma-1133

In the given multiplication (which contains no zeros), different letters stand for different digits but the same letter always stands for the same digit and a smiley face of course, can be any digit.

If YES is odd, how big is your SMILE?

[enigma1133]

Enigma 378: A sleeper awakes

From New Scientist #1527, 25th September 1986 [link]

I fell asleep during a lecture and dreamed that I was out in the country. In my dream I saw a field and in this field some four-legged cows being milked by at least one two-legged milkmaid who had the use of a number of three-legged stools. There were more stools than would suffice for one per milkmaid, and more cows than would suffice for one per milking stool.

Given this information, and the number of legs in the collection, I realised that one could work out unambiguously the number of cows, stools and milkmaids in the field. Furthermore, the number of legs in the field was the largest it could have been, consistent with these facts.

I awoke with quite a start when the lecturer addressed a question to me. Unfortunately, the answer I gave to his question was the number of cows, milking stools and milkmaids that I had dreamed of. Of course, everyone laughed, but I bet they wouldn’t be able to solve that in their sleep!

How many milkmaids were there in my dream, and how many milking stools and cows?

[enigma378]

Tantalizer 494: Moaning at the bar

From New Scientist #1045, 31st March 1977 [link]

Burpwater’s Best is not the greatest of beers and is to be had only in the five pubs owned by the brewery. The customers are so rude about it that the landlord keeps putting in for transfers. Until four years ago these requests were always refused but there was then a change of policy, resulting in complete annual reshuffles. Now, after four such upheavals, each landlord has had a disgruntled go at running four of the pubs and it at present ensconced in the fifth.

Patrick’s first move was from the Duck to the Anchor and his next to the Cormorant. This second shuffle took Quentin to the Eagle and Roger to the pub previously run by Tony. At the third move Tony handed the Bull over to Roger, who took over from Simon at the following move.

Where is each gloomy publican to be found now?

[tantalizer494]

Puzzle 85: Addition: digits all wrong

From New Scientist #1137, 11th January 1979 [link]

In the following addition sum all the digits are wrong. But the same wrong digit stands for the same correct digit wherever it appears, and the same correct digit is always represented by the same wrong digit.

Puzzle 85

Find the correct addition sum.

This puzzle was republished in New Scientist #1316 (29th July 1982) as Enigma 171.

[puzzle85]

Enigma 1134: Luck be a lady

From New Scientist #2290, 12th May 2001

I’ve asked Mystic Mog to advise me on my choice of lottery numbers. She has a way of assigning a measure of luck to each of the numbers from 01 to 49. She has given each of the digits a “luck factor”, with 0’s being less than 1’s, which is less than 2’s, etc. Then to calculate the luckiness of any of the lottery balls she simply adds together the luck factors of the two digits. For example, she regards 27 as luckier than 31 because the digit 2 has a higher luck factor than the 1 and the 7 has a higher luck factor than the 3.

She also tells me that if you consider all the balls excluding number 25, then precisely half of them are luckier than number 25 and half are less lucky than 25. Knowing all these facts, I can decide for most balls whether they are luckier than 25 or not. There are just three balls that I cannot decide about.

Which three?

[enigma1134]

2016 in review

Happy New Year from Enigmatic Code!

There are now 1,028 Enigma puzzles on the site (plus a few other puzzles). There is a complete archive of all puzzle published from January 1979 to September 1986 and also from May 2001 to December 2013, which is about 57.5% of all Enigma puzzle published in New Scientist and leaves around 760 puzzles to add to the site.

In 2016 I added 105 Enigma puzzles to the site (as well as a puzzles from other sources). Here’s my selection of the ones I found most interesting to solve this year:

Older Puzzles (1985 – 1986)

Newer Puzzles (2001 – 2002)

Other Puzzles

I have continued to maintain the enigma.py library (in particular I added some routines to help in solving football problems with letters substituted for digits in score tables, and for solving general Alphametic problems). I wrote up some notes on the solving of Alphametics using Python here and here, and the SubstitutedExpression() class in enigma.py can now be used to solve many Enigma problems directly.

Since switching to posting puzzles on Monday and Friday I have also added Wednesday Bonus Puzzles, which are posted on Wednesdays (naturally), if I have the time. Unless there is a particularly interesting puzzle that’s caught my eye that week I will alternate posting Tantalizer (set by Martin Hollis) and Puzzle (set by Eric Emmet) problems, which are the predecessors of the Enigma puzzles in New Scientist. (Although Eric Emmet seems to like puzzles involving substituted addition or division sums, and football problems a bit too much for my liking).

Thanks to everyone who has contributed to the site in 2016, either by adding their own solutions (programmatic or analytical), insights or questions, or by helping me source puzzles from back-issues of New Scientist.

Enigma 377: Cricket, lovely cricket

From New Scientist #1526, 18th September 1986 [link]

Enigma 377

Three runs were scored in each over and they were all scored in singles.

What was the number of runs scored at the fall of each wicket?

[enigma377]

Tantalizer 495: Bound variables

From New Scientist #1046, 7th April 1977 [link]

Morning coffee at the Logicians’ Union could be with or without any or all of milk, sugar and biscuits. You ordered as you went in by putting your name on any or all of three lists headed “milk”, “sugar” and “biscuits”.

Well, that was not too hard and, by the time Professor Haarschneider was half way through his seminal paper on Semi-opaque Designators, 21 names appeared under each heading. It fell to Professor Nachtwebel, as president, however, to regroup the names into the appropriate seven subsets. Working on the back of an envelope in Polish notation, he found that no two subsets were the same size, that the smallest had three members and that the largest was of those requiring milk but neither sugar not biscuits.

As it was by now the hour appointed for luncheon, the delegates had to forego coffee. How many of those who would have taken sugar were also hoping for biscuits?

[tantalizer495]

Enigma 1135: Perfect harmony

From New Scientist #2291, 19th May 2001

The Ancient Greeks studied “harmonic triads” of integers, the simplest of which is {2, 3, 6}. The middle number is known as the “harmonic mean” of the other two and is calculated so that its reciprocal is the mean (“average”) of the reciprocals of the other two numbers. George has constructed a “harmonic square” — nine different integers in a 3 × 3 grid such that in each of the three rows, the three columns and the two diagonals, the three numbers form a harmonic triad with the harmonic mean in the middle.

Using his computer, George has discovered that the smallest number which can appear in such a square is 210. You should need only progressive intuition to deduce the other eight numbers which accompany 210 in a harmonic square.

What is the largest of these numbers?

[enigma1135]

Enigma 376: Letters decide to divide

From New Scientist #1525, 11th September 1986 [link]

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

enigma-376

Rewrite the sum with the letters replaced by digits.

[enigma376]

Puzzle 86: The worst was first

From New Scientist #1138, 18th January 1979 [link]

A lot of experts did a great deal of hard thinking to produce a new football method designed to encourage more goals and therefore to produce matches that would be likely to be more attractive to the spectators. Under this method 10 points were awarded for a win, 5 points for a draw and 1 point for each goal scored, whatever the result of the match. But it seems that perhaps there was not enough thinking, for in a recent competition between four teams, A, B, C and D, who all played each other once, the team that came first lost all their matches. The result was as follows:

B – 45 points
D – 43 points
A – 39 points
C – 34 points

In the matches between A, C and D not more than 3 goals were scored in any match, and in the matches which B played neither side scored more than 18 goals. Each match that was won was won by a single goal.

Find the score in each match.

[puzzle86]

Enigma 1136: Triangular numbers

From New Scientist #2292, 26th May 2001

Triangular numbers are those that fit the formula ½n(n+1), like 1, 3, 6 and 10.

In the following statement digits have been consistently replaced by capital letters, different letters being used for different digits:

“ONE, THREE, SIX and TEN are all triangular numbers, none of which starts with a zero”.

Which numbers are represented (in this order) by ONE, THREE, SIX and TEN?

[enigma1136]

Enigma 375: Miles out

From New Scientist #1524, 4th September 1986 [link]

A French friend had a road journey to make from London and he knew the shortest distance in miles, so he wanted to know what fraction to multiply by to make it into kilometres.

“Just multiply by 2.”
“No, 3/2 is better.”
“No, 5/3 is more accurate.”
“No, 8/5 is more usual.”

Those were the suggestions made to him and each would have led him to calculate the distance as a whole number of kilometres.

The suggested fractions were, by chance, all obtained by taking a pair of successive terms in the well-known sequence 1, 2, 3, 5, 8, … where new terms are calculated by adding the two previous terms. This led me, knowing that one mile is 1.60934 kilometres, to calculate which pair of successive terms of the sequence would give the best fraction to use. I reported my findings to my French friend and this fraction, too, led him to calculate his distance as a whole number of kilometres.

How far, in miles, was his journey?

[enigma375]

Tantalizer 496: Anky panky

From New Scientist #1047, 14th April 1977 [link]

Having unearthed a thriving protection racket in the nursery class, Miss Marple summoned the mothers of the six boys concerned to a friendly little chat. She settled the embarrassed ladies equidistantly round a circular table, while she herself paced about lecturing them.

The seating is what concerns us. On Pam’s right sat Mrs Fagin, mother of Yvor. Xerxes’ mum had Ulrich’s mum, Rhona, on her right and Sylvia on her left. Vince’s mum was on Pam’s left and opposite Sylvia. Willy’s mum was opposite Queenie, who sat on Mrs Armstrong’s right. Zacharia’s mother was opposite Mrs Capone. Tess sat opposite Mrs Ellis. Olive was on Mrs Diamond’s left.

Only Mrs Borgia had the guts to blame the whole thing on the school. Can you discover her first name?

[tantalizer496]

Enigma 374: Just the ticket

From New Scientist #1523, 28th August 1986 [link]

Mr Bagel was intrigued when approached by Mr Bola selling raffle tickets, for he had never taken part in a raffle.

“I see that each ticket in your book has the same number of digits on it, the first having a number of zeros followed by a one, and the number on each successive ticket increasing by one.”

“That’s true,” replied Bola. “I haven’t sold any yet. Perhaps that’s because there is to be only one winning ticket.”

“Now tell me, Tom,” asked Bagel, “what happens if a ticket number is composed entirely of invertible digits, namely 0, 1, 8, 6 or 9, so that is also forms a number when viewed upside down?”

“In a draw we always read the tickets out with the perforation on the left,” replied Bola.

“That’s a pity, otherwise one could buy two numbers for the price of one ticket.”

Bagel, being superstitious, chose a ticket with an invertible number. One way up the number was divisible by all the even digits, and the other way up it was divisible by all the odd digits. Moreover, when his ticket number was multiplied by a digit (I forget which), the product was the number of the last ticket in the book, a number in which none of the digits was invertible.

I forget whether he won the draw, or even what the draw was for. But, given the chances of his winning were better than one in 100,000, what was the number on the last ticket in the book?

[enigma374]