Enigmatic Code

Programming Enigma Puzzles

Category Archives: enigma

Enigma 992: Chain of cubes

From New Scientist #2147, 15th August 1998

I have constructed a cyclical chain of 4-digit perfect cubes such that each cube has at least two digits (but not necessarily the same digits) in common with each of its neighbours in the chain. The chain consists of as many different 4-digit cubes as is possible consistent with the stipulation that no cube appears in it more than once.

If a cube has a repeated digit, that digit only counts more than once in calculating the number of digits it has in common with another cube if it also appears more than once in the other cube; so 1000 has three digits in common with 8000, but only one digit in common with 4096.

Which two cubes are the neighbours of 9261 in the chain if:

1. Somewhere in the chain two neighbouring cubes have more than two digits in common?

2. Nowhere in the chain do two neighbouring cubes have more than two digits in common?

[enigma992]

Enigma 517: Walk in the dark

From New Scientist #1669, 17th June 1989 [link]

Out there, somewhere in the night, is Elk Elloy, gunning for me. My only hope is to stay in the dark.

Stretching ahead of me is the Boulevard, all 3686.3 yards of it. If I can make the other end of it then I’ll be safe. But the whole length of the Boulevard is covered with neon strip lights. One hundred and ninety-three of them, each 19.1 yards long, set out end-to-end. They flash on and off steadily through the night. There go the 1st, 3rd, 5th, 7th, …, 193rd. They’re on for just an instant. Now there is a 12-second pause and then on come the 2nd, 4th, 6th, …, 192nd, for just an instant. Then another 12-second pause and we begin all over again with the odd numbered strips.

Fortunately, each strip only lights the ground directly below it, so there is a chance I can walk along the Boulevard and avoid ever being under a strip when it comes on.

There are just two catches. First, I must walk at a constant speed which is a whole number of yards per minute, otherwise I will arouse the suspicion of Patrolman Nulty who covers the Boulevard. Secondly, I cannot walk at more than 170 yards per minute.

What speed should I walk at, in yards per minute?

[enigma517]

Enigma 993: If you lose…

From New Scientist #2148, 22nd August 1998

Each year the four football teams A, B, C and D play each other once, getting 3 points for a win and 1 for a draw. At the end of the year the teams are ordered by total points and those with equal points by goal difference. Any still not ordered are then ordered by goals scored and then, if necessary, by the result of the match between the two to be ordered. Any still not ordered draw lots. The top two teams with a prize.

The order the games are played in can vary, except that A always plays its opponents in the order B, C, D, and A vs B is always the very first match of the year.

By an amazing coincidence the following has happened in 1996, 1997 and 1998. One hour before A v C kicks off, team A’s manager/mathematician announces to the team that if they lose to C then they cannot possibly get a prize. Team A has gone on to win a prize in spite of losing to D.

1. Is it possible in 1996 A vs C was the 3rd game of the tournament?

2. In 1997, A vs C was the 4th games of the tournament. Name the two teams that you can say for certain met in the 2nd or 3rd game of the tournament.

3. In 1998, a total of 4 goals was scored in the tournament. What was the score in B vs C?

[enigma993]

Enigma 516: The ABC of division

From New Scientist #1668, 10th June 1989 [link]

In the following division sum each letter stands for a different digit. Rewrite the sum with the letters replaced by digits.

[enigma516]

Enigma 994: Lake land

From New Scientist #2149, 29th August 1998

George is contemplating buying a farm which is a very strange shape, comprising a large triangular lake with a square field on each side. The area of the lake is exactly seven acres, and the area of each field is an exact whole number of acres.

Given that information, what is the smallest possible total area of the three fields?

[enigma994]

Enigma 515: Foreign ties

From New Scientist #1667, 3rd June 1989 [link]

The Anglo-Slovak club had its meeting last week. Those present were Tom, Vyctur, Ted, Tago, Ray, Min, Wex, Olav, Russ and Cy.

Some of the members stood up and took part in an old Slovakian dance, rather like a Morris dance. The dancers stood around the floor with no three in a straight line and between each pair a taut piece of ribbon was stretched across the floor. Some ribbons were pink and the rest were blue. I noticed that there was a pink ribbon between two of them precisely when their Christian names had an odd number of letters in common. (So, for example, had a Jane, David and Victor been dancing, there would have been a pink ribbon from Jane to David, a blue from David to Victor, and a blue from Jane to Victor).

As soon as I saw how many dancers there were I realised that two of the ribbons would have to cross. But they had arranged themselves in such a way that there was no pink triangle and no blue triangle of ribbons.

Who was dancing?

[enigma515]

Enigma 995: Number please

From New Scientist #2150, 5th September 1998

This is the layout of the digit buttons on my telephone. My boss’s telephone number uses each of the ten digits once and it starts with 0. Furthermore each pair of adjacent digits in her telephone number is also adjacent (horizontally, vertically or diagonally) on the telephone keypad. (By coincidence my own number, 0895632147, has the same properties).

I have just looked through my boss’s telephone number and written down a list of all the two-figure numbers that can be seen in it by reading a pair of adjacent digits (which would be 89, 95, 56… in my number). In that list, some of the numbers are special in that they consist of two digits which are also consecutive (such as 89, 56, 32 and 21 in my number). I have worked out the product of those special numbers and it is the year in which my boss will be 50. And if I look at the number of the year in which she was born, no two of its adjacent digits are adjacent (either way round) in her telephone number.

What is her telephone number?

Enigma 486 is also called “Number please”.

[enigma995]

Enigma 514: State of the parties

From New Scientist #1666, 27th May 1989 [link]

I wrote to a mathematical friend in Utopia and asked him to send me the results of the recent general election there. He decided to make me work for it, as you can see from his reply:

Dear Friend,

(1) The Dextrous Party lost control of the Scitting (our 600-seat parliament) and now has fewer seats than the Sinistrals. The Other and Indeterminate Parties remained third and fourth respectively.

(2) No new party was elected to the Scitting and none was removed.

(3) No party has an overall majority in the new Scitting.

(4) The Other Party lost almost half its seats, while the Indeterminate Party exactly doubled its seats.

(5) In the last Scitting all four parties held a perfect square of seats (the Other’s figure was also a perfect cube). In the new Scitting, two have perfect squares while the other two have perfect fifths (a whole number raised to the fifth power). No party had or has only one seat.

So now you can determine the composition of both old and new Scittings.

Can you?

[enigma514]

Enigma 996: Change of weight

From New Scientist #2151, 12th September 1998

You may think you have seen this puzzle before but the solution this time is different. Just as before, each letter stands for a different digit, the same letter represents the same digit wherever it appears and no number starts with zero. But this time THREE is an even number.

What is your WEIGHT?

[enigma996]

Enigma 513: Less than a bargain

From New Scientist #1665, 20th May 1989 [link]

The fruit stall proclaimed, “Our fruit is so cheap it is even less than a bargain”, and so it had a good number of customers.

Hannah bought an apple and two bananas and yet spent less than Sarah who bought an orange and a 10-pence lemon. Joan bought 10 apples, 11 bananas and two oranges and yet did not spend all the 107 pence in her purse. Alan bought three apples, two bananas and an orange and his bill was less than 30 pence. Only Mot was unlucky: he tried to buy eight apples, seven bananas and two oranges, but they came to more than the 79 pence in his pocket.

Each piece of fruit cost a whole number of pence.

What was the cost of each apple, banana and orange?

[enigma513]

Enigma 997: Building sites

From New Scientist #2152, 19th September 1998

A small building site is offered for sale, divided into three plots, each at the same price per acre.

The plots are all rectangles of different sizes but each is the same shape as the overall site — that is, the ratio of the sides is the same for each, although two of the rectangles are rotated through 90° relative to the other two.

If the asking price of the largest plot is £20,000 more than that of the smallest, how much is the middle-sized plot?

[enigma997]

Enigma 512: Sufficient evidence

From New Scientist #1664, 13th May 1989 [link]

Four football teams are to play each other once. After some of the matches have been played a document giving some details of the matches played, won, lost and so on looked like this:

Enigma 512

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

Find the score in each match.

[enigma512]

Enigma 998: Multiple purchases

From New Scientist #2153, 26th September 1998

The denominations of coins in circulation which are less than a pound are 50, 20, 10, 5, 2 and 1p.

Harry, Tom and I went into a shop recently and each made a purchase costing less than £1 (100p). The cost of each of these purchases was different. We each paid with a £1 coin and each received four coins in change — in each case the change due could not be given in fewer than four coins; but equally if we had paid the exact price for our purchases it would have been possible for each of us to have done so with four coins, but not with fewer.

The total cost of our three purchases was not only more than, but also an exact multiple of, the total amount of change than between us we received.

What did each of our purchases cost?

[enigma998]

Enigma 511: Double, double …

From New Scientist #1663, 6th May 1989 [link]

I wrote an odd number on the board and asked the class how many numbers (including the original number itself) could be made by writing exactly the same digits but in different orders. (For example, if the number had been 5051, the answer would have been nine, namely 5051, 5015, 5105, 5150, 5501, 5510, 1055, 1505 and 1550).

Clever Dick got the right answer immediately, so to keep him busy I told him to repeat the exercise with exactly double my original number.

“That just doubles the number of ways, Miss,” he reported.

I told him to double again and repeat the exercise, and again he reported “That doubles the number of ways yet again, Miss.”

So I told him to double the number yet again and to repeat the exercise with the four-figure answer.

“It’s doubled the number of ways again, Miss,” he replied and, as always, he was quite right.

What number did I write on the board?

[enigma511]

Enigma 999: Combined celebrations

From New Scientist #2154, 3rd October 1998 [link]

To celebrate next week’s 1000th edition of Enigma, we each made up an Enigma. Each one consisted of four clues leading to its own unique positive whole number answer. In each case none of the four clues was redundant. To avoid duplication, Keith made up his Enigma first and showed it to Susan before she made up hers.

The two Enigmas were meant to be printed side-by-side but the publishers have made a (rare) error and printed the clues in a string:

(A) It is a three-figure number;
(B) It is less than a thousand;
(C) It is a perfect square;
(D) It is a perfect cube;
(E) It has no repeated digits;
(F) The sum of its digits is a perfect square;
(G) The sum of its digits is a perfect cube;
(H) The sum of all the digits which are odd in Keith’s answer is the same as the sum of all the digits which are odd in Susan’s.

Which four clues should have formed Keith’s Enigma, and what was the answer to Susan’s?

There are now 1300 Enigma puzzles available on the site (or at least 1300 posts in the enigma category). There are 492 Enigma puzzles remaining to post.

There are currently also 76 puzzles from the Tantalizer series, 75 from the Puzzle series and 13 from the new Puzzle # series of puzzles that have been published in New Scientist which together cover puzzles from 1975 to 2019 (albeit with some gaps).

I also notice that the enigma.py library is now 10 years old (according to the header in the file – the creation date given coincides with me buying a book on Python). In those 10 years it has grown considerably, in both functionality and size. I’m considering doing a few articles focussed on specific functionality that is available in the library.

[enigma999]

Enigma 510: Out of court

From New Scientist #1662, 29th April 1989 [link]

Professor Puzzleothers has privately decided to allow his ex-wife a resettlement of precisely one third his current annual salary, but only if she can work out exactly how much she is to get.

He instructs his solicitor to tell her lawyers that he will agree to alimony calculated according to the following formula.

She has to find two numbers A and B which between them contain each of the digits from 1 to 9 exactly once and contain no 0 digit, such that B = 2A, A is divisible by 3, and the quotient when A is divided by 3 is a number which contains all the digits from 1 to 4. Then £A will be the annual settlement.

What does Puzzleothers currently earn?

[enigma510]

Enigma 1000: One thousand times

From New Scientist #2155, 10th October 1998 [link]

Since M is the Roman numeral for 1000, we can say that with this puzzle New Scientist has published its Enigma M times — which is significant because:

ENIGMA ÷ M = TIMES

In this problem each letter stands for a different digit, and the same letter represents the same digit wherever it appears. No number starts with a zero.

I reckon that, with the extra puzzles that are sometime published under the same number at Christmas time, by the time Enigma 1000 was published there had actually been 1011 Enigma puzzles in New Scientist.

However, a number of the puzzles in that range were flawed (I have found 17 so far, and there are 494 puzzles remaining to add to the site).

Enigma 401 is unusual, as not only was the flaw acknowledged by New Scientist, but a corrected version of the puzzle was published as Enigma 405. Also Enigma 9 is identical to Enigma 83. Together these reduce the count by 2 to give 1009 puzzles published.

[enigma1000]

Enigma 509: Banking on a prime

From New Scientist #1661, 22nd April 1989 [link]

I have two accounts at Midloids bank, both with unusual eight-digit account numbers, which are made up of a combination of only odd digits.

If either of the account numbers is split in half it gives two four-digit prime numbers. These two primes contain the same four digits, but in a different order, and with no digit repeated. Furthermore if these four-digit primes are split in half, they each give two two-digit prime numbers.

If, for both numbers, the prime formed from the first four digits is larger than the prime formed from the second four digits, what are the numbers of my accounts?

[enigma509]

Enigma 1001: What the hex?

From New Scientist #2156, 17th October 1998 [link]

In this hexagon of circles I’ve written some digits:

Reading the six sides, clockwise, as three-figure numbers you get 187, 714, 425, 527, 799, and 901, all of which are multiples of 17. Your task today is to write a new collection of non-zero digits in the circles, with no two adjacent digits the same, so that the six three-figure numbers are all different multiples of some particular two-figure number, the number in the top row being twice that two-figure number.

What are the numbers in your hexagon?

[enigma1001]

Enigma 508: A colourful deception

From New Scientist #1660, 15th April 1989 [link]

Tour the Tulip Fields of Bulbania

Enigma 508

Towns: Aldingsp, Beachhol, Chholbea, Dingspal, Eachholb, Fresh, Gspaldin.

The colours are those of the tulips in that area.

You will fly to Eachholb and then drive by coach, visiting each town exactly once.


“Miss Wheel, I understand you will be driving the coach for the tour. I am afraid we have a problem. The flight is being diverted to Chholbea, so you will collect your passengers there.”

“We do not want the tourists to realise there has been a change to the tour as advertised on the above leaflet, as they might ask for their money back. Now, they will not be able to read the names of the towns as they are in Bulbanian, but they can tell the colours of the tulips and they have the map. I want you to start at Chholbea and drive round visiting each town exactly once, but so that as the tourists notice the colours on each side of the road, they will believe from their map that they are following a route as described on the leaflet, beginning at Eachholb.”

What route did Miss Wheel take and what route did the tourists think they were taking?

Some of the Bulbanian towns are anagrams of the Lincolnshire town of Spalding, and others are anagrams of town of Holbeach, also in Lincolnshire.

[enigma508]

%d bloggers like this: