Enigmatic Code

Programming Enigma Puzzles

Enigma 1207: Nice ones

From New Scientist #2362, 5th October 2002

We had a gathering of our very respectable and mathematically inclined family recently to celebrate the forthcoming centenary of its oldest surviving member.

Out of interest I pointed out to them that, given any odd number which does not end in 5, some multiple of it must consist simply of a string one ones. For example, if you look at 71 then the number 1111111… consisting of thirty-five ones is a multiple of it!

This set the family chattering and Alan wrote down the shortest string one ones which was a multiple of his age.

Alan’s father, Bob, then rubbed out a majority of the ones to leave the shortest string of ones which was a multiple of his age. Bob’s grandfather, Colin, then rubbed out a majority of the remaining ones to leave the shortest string of ones which was a multiple of his age.

How old is Bob?


Enigma 305: League of four

From New Scientist #1453, 25th April 1985 [link]

In the following football table digits (from 0 to 9) have been replaced by letters. The same letter stands for the same digit wherever it appears, and different letters stand for different digits. The four teams are eventually going to play each other once.

Enigma 305

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

Find the score in each match.


Enigma 1208: Puzzle panel

From New Scientist #2363, 12th October 2002

In an edition of BBC Radio 4’s Puzzle Panel the members of the panel were asked to solve the equation A/B + C = D, where A, B, C and D are four different integers, each of which when written as a word consists of five letters. The outrageous answer was 144/12 + 8 = 20, because 144 is a GROSS, 12 is a DOZEN and 20 is a SCORE!

But the puzzle can be solved in a much more conventional and legitimate way if it is set in either French or Italian, even through each language has only five integers that when written as words consist of five letters.

Your task is to write out the numerical version of the equation (as above for the English version) that you would give for (a) the French and (b) the Italian version of the puzzle.


Enigma 304: Enigmatic dates

From New Scientist #1452, 18th April 1985 [link]

In this puzzle dates are written in the form 17/3/08 or 9/12/72 but then the /s are deleted and the digits consistently replaced by letters, different letters represent different digits.

I was born on ENIGMA. So how old was I on EMPTY? I was __ years old (and AGE days to be precise). By the end of 1999 I shall be ON in years.

What’s the POINT?


Enigma 1209: The league game

From New Scientist #2364, 19th October 2002

Lloyd and Owen have a new game. They imagine there is a football league with four teams, A, B, C and D. Each team plays every other team once, scoring 1 point for a draw and 2 for a win. The teams are ordered in their league by points and, where there are equal points, by goal difference.

At the start of their game, Lloyd has six cards in his hand, each with a different match on it, A v B, A v C, etc. The game consists of six rounds, numbered 1 to 6 in order. In each round Lloyd chooses one of the cards in his hand and lays it on the table. Owen writes a score on it, for example if the card was A v B, he might write A2 v B1. They then work out the league table for the matches played so far and see who is top. They also work out if it is certain that the team will be top after all the six matches have been played, whatever the scores of the remaining matches. If it is certain and it was not certain in the previous round then that round is called the “Decisive” round. That completes the round.

Lloyd plays so as to make the Decisive round as late as possible and Owen aims to make it as early as possible.

Question 1: If they both play as well as possible, what is the number of the Decisive round?

Question 2: If they change the rules so that a team gets 3 points for a win, what then is the number of the Decisive round?


Enigma 303: Some dominoes

From New Scientist #1451, 11th April 1985 [link]

Most of a full set of dominoes has been arranged in a 7 × 7 block with a hole in the middle. Please mark in the boundaries between the dominoes. There is only one answer.

Enigma 303


Enigma 1210: ELITE TILE

From New Scientist #2365, 26th October 2002

You are probably familiar with the puzzle consisting of 15 sliding tiles as shown.

Enigma 1210

By sliding the tiles around you can make various arrangements and then read off each row as one long number. For example, the first row might consist of 3, 1, 8 and 13, which could be read as the palindromic number 31813.

I formed one arrangement recently in which the numbers formed by three of the four rows were palindromic and the number formed by the remaining row was exactly six times a palindrome.

What was that non-palindromic row?


Teaser 2759: King Lear II

From The Sunday Times, 9th August 2015 [link]

King Lear II had a square kingdom divided into 16 equal smaller squares. He kept one square and divided the rest equally among his daughters, giving each one an identically-shaped connected piece. If you knew whether Lear kept a corner square, an edge square or a middle square, then you could work out how many daughters he had.

The squares were numbered 1 to 16 in the usual way. The numbers of Cordelia’s squares added up to a perfect square. If you now knew that total you could work out the number of Lear’s square.

What number square did Lear keep for himself and what were the numbers of Cordelia’s squares?


Enigma 302: The Grand Enigma

From New Scientist #1450, 4th April 1985 [link]

The Puzzlers’ Union has just finished electing a new Grand Enigma, as its union president is called. Hook, Line and Sinker were the three candidates. Each canvassed shamelessly, and each arrived at the count expecting to receive 79 votes. As the total possible number of votes cast was, in fact, precisely 100, each was in for a surprise.

The Puzzlers’ Union has eight branches, all of different sizes and none of less than three members. Each branch made whatever promises it saw fit and, indeed, cast its votes en bloc. But, you may rightly infer, not all branches voted as promised. One branch had rashly pledged itself to all three candidates and then voted for no one. Three branches were pledged to two candidates — a different two in each case — and resolved the dilemma by voting for a third. This manoeuvre benefited Hook most, Line next and Sinker least. One branch promised no one and voted for no one. The remaining three branches were pledged one to Hook, one to Line and one to Sinker; and these pledges were kept in the vote.

Precisely how many votes did each candidate actually receive?

In New Scientist #1454 the following correction to this puzzle was published (I’ve removed the statement of the solution):

Martin Hollis writes: “As set, the puzzle has several solutions. In the first paragraph, 100 should have been given not as the total number of votes cast, but as the total possible. […] My apologies to all.”

I have modified the puzzle above accordingly.


Enigma 1211: Four rooms

From New Scientist #2366, 2nd November 2002

There are four logicians, Anna, Barbara, Cara and Dora, who are in four rooms, P, Q, R and S, respectively. Each room is painted yellow or green. The distribution of paints is one of the following nine: YYGY (i.e. P is Y, Q is Y, R is G and S is Y), YYYG, YYYY, YYGG, YGGY, GYYY, GGYY, GGYG and GGGG. I give the list to the four logicians. Two of them, whenever they write anything down, always write the opposite of what they believe is true. Each logician has no outside knowledge of what is happening outside her room.

Anna gives me a piece of paper on which she has written, ‘the colour of room P is …’, with a colour in place of the three dots. I give the paper to Barbara who takes the information on it as being true. She deduces, from all the information she has, what she believes to be the colour of room S; she gives me a piece of paper on which she has written, ‘the colour of room S is …’.

I give the paper to Cara, who carries out a similar activity to Barbara, ending with Cara giving me a piece of paper with a statement that room P is a certain colour. I give the paper to Dora who carries out a similar activity to Barbara and Cara, ending with Dora giving me a piece of paper with a statement that room Q is a certain colour.

I give it to Anna who carries out a similar activity to Barbara, Cara and Dora, ending with Anna giving me a piece of paper with a statement that room R is a certain colour.

What are the colours of the four rooms?


Enigma 301: Adding letters

From New Scientist #1449, 28th March 1985 [link]

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

Enigma 301

Write out the sum with numbers substituted for letters.


Enigma 1212: Repdigits

From New Scientist #2367, 9th November 2002

George and his three brothers have taken up the study of repeated digit numbers reported by Susan Denham in an earlier Enigma. Every number which is not a multiple of two or five has multiples consisting of repetitions of a single digit, 1, 3, 7 or 9. For example the numbers 111111111111111111, 333333, 777777777 and 999999 are all multiples of 63. Furthermore, they are the smallest multiples of 63 comprising repetitions of 1, 3, 7 and 9. The total number of digits in these four numbers is 18 + 6 + 9 + 6 = 39.

The four brothers have totalled their ages, and George has identified the smallest number comprising all ones which is a multiple of the total age. His brothers have found the smallest numbers comprising repetitions of three, seven and nine which are multiples of the total age. They found that the four repdigit numbers have four different numbers of digits.

What is the total of the four numbers of digits?

The earlier Enigma referred to by this puzzle is Enigma 1207.


Enigma 300: Changes, etc

From New Scientist #1448, 21st March 1985 [link]

The five officers of the Enigma Thinkers Club (ETC) are, in decreasing order of rank, President, Vice-president, Treasurer, Secretary and Entertainments Officer. The five previous holders of these offices recently all changed roles, each taking over one of the five positions which he had not previously held.

The Vice-president’s predecessor and the person who formerly held the Vice-president’s predecessor’s new job both agree that the new Entertainments Officer suffered the worst drop in rank.

The man who filled the post vacated by the person who took over the new President’s old job says that he is now senior to someone to whom he was previously junior.

The Secretary says that in neither administration has he been junior to the former Secretary.

The reshuffle has rewarded the honest: all those who were promoted aways tell the truth, and all those who were demoted always lie.

What, in order, were the previous positions held by the current President, Vice-president, Treasurer, Secretary and Entertainments Officer?


Enigma 1213: Sum coincidence

From New Scientist #2368, 16th November 2002 [link]

I have a little numerical party trick. I ask my audience to choose 10 different whole numbers less than 100 and from those 10 I find two quite separate collections with the same sum. For example, if they chose:

2, 6, 11, 19, 29, 45, 67, 68, 71 and 98

then one of my possible choices would be to note that:

2 + 68 = 6 + 19 + 45
or that 2 + 6 + 11 = 19

I tried a simpler version of this trick with my young niece. I asked her to choose five different whole numbers less than 13, and again I knew that I would be able to find two separate collections with the same sum.

She then asked me if it worked for any five numbers less than 14, and so we tried a few. This time she managed to find a set of five different numbers less than 14 among which there were no two separate collections with the same sum.

She then took the lowest of the five numbers and tripled it, leaving the other four unchanged. She got another set of five different numbers less than 14 among which there were still no two separate collections with the same sum.

What was this last set of five numbers?


Enigma 299: Edge-equal tetra

From New Scientist #1447, 14th March 1985 [link]

Enigma 299

The first picture shows a bird’s eye view of a tetrahedron with a number (a positive whole number) on each face, vertex and edge. The repeated 1 is on the bottom face which is out of sight.

The numbering is “edge-equal”, because every edge-number is the sum of the numbers on the two adjacent faces and also the sum of the numbers on the two adjacent vertices. 10 = 4 + 6 = 2 + 8, and 7 = 2 + 5 = 6 + 1, and so on.

That numbering has all the 8 face-numbers and edge-numbers different, which is nice, but if you count in the 6 edge-numbers too there is a duplication of 5, 7 and 8.

The second picture is for you to fill in an edge-equal numbering with all 14 numbers different. I had already put in the largest number, 21. The smallest number is to go on the bottom face, please.


Enigma 1214: A card trick

From New Scientist #2369, 23rd November 2002 [link]

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 [link]

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 [link]

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?



Get every new post delivered to your Inbox.