Enigmatic Code

Programming Enigma Puzzles

Tag Archives: by: Christophe Maslanka

Enigma 505: A pretty puzzle

From New Scientist #1657, 25th March 1989 [link]

I was just sitting down to crumpets and honey in The Wykeham Tea Room when Bob Cowley appeared carrying a basketball. He handed me a slip of paper.

“A, B & C all stand consistently for digits throughout this equation. I won’t tell you whether any of the digits are the same or not as I don’t want to spoil your fun”, said Bob.

Certainly, it was a pretty equation:


though I had once seen a prettier one in an amusement arcade in Bognor Regis.

It should, of course, be as easy as ABC to solve this before the crumpets cool. Can you help me find the digits corresponding to A, B and C?


Enigma 501: A reciprocal arrangement

From New Scientist #1653, 25th February 1989 [link]

“As you insist on disturbing my peace of mind with puzzles”, remarked Potter to Kugelbaum as they sat down to drinks at the Maths Club, “it is only fair that you submit to the same fate”. Kugelbaum agreed. “The Egyptians expressed fractions as sums of reciprocals”, continued Potter. “For example, they wrote 3/8 = 1/8 + 1/4. That and the notion of getting one over you inspires this puzzle:”

“The smallest integer, U, such that 1/U may be expressed as the sum of exactly two reciprocals in exactly and only two distinct ways is 2; for 1/2 = 1/4 + 1/4 and 1/2 = 1/3 + 1/6 and there are no other ways of doing it. The second smallest is 3, since 1/3 may be expressed as the sum of exactly two reciprocals in exactly and only two distinct ways: 1/3 = 1/6 + 1/6 and 1/3 = 1/4 + 1/12. Again there are no other ways. But the third smallest value of U is not 4, since 1/4 may be expressed as the sum of two reciprocals in three distinct ways.”

“Yes”, said Kugelbaum in reply, “and namely 1/8 + 1/8; 1/6 + 1/12; and, of course, 1/5 + 1/20. What is your question?”

Potter drew himself up: “What is the eighth smallest value of U, such that 1/U is expressible as the sum of exactly and only two reciprocals in exactly and only eight distinct ways?”

Kugelbaum’s eyes glazed over and the cogs began to whir. In fact, Potter didn’t even know if the question had an answer and so when Kugelbaum gave the answer, he had to take it on trust. Given that Kugelbaum is never wrong, what was his answer?


Enigma 485: A digital question

From New Scientist #1636, 29th October 1988 [link]

“0234 871956?” remarked Telephonopoulos on hearing Ms Omnidigitalis’s telephone number. “Why, it contains all the 10 digits once and once only.”

“That’s not all that’s interesting about it,” she replied. “It’s divisible by 11 without remainder. That’s if you agree to treat it as being the same number as 234,871,956: that is, to discount the initial zero.”

“There must be quite a few numbers consisting of 10 digits, none of them repeated within the same number, which are divisible by 11 without remainder.”

Exactly how many are there if:

(a) They are not constrained to begin with 0?
(b) They are constrained not to begin with 0?


Enigma 480: An irrational question

From New Scientist #1631, 22nd September 1988 [link]

Kugelbaum was running through a geometrical proof with some of his students when he suddenly went off at a tangent.

“What an extraordinary rectangle I have just drawn!” he remarked out loud. “Why, the number of inches in the perimeter is an integer equal to the number of square inches in its area. And yet, no one of its sides is a rational number of inches long”. (A rational number is one which can be expressed as the ratio of two definite integers: for example 1.5, but not √2).

What is the smallest possible perimeter of such a rectangle, measured in inches?

Happy Christmas from Enigmatic Code.


Enigma 476: A curious question

From New Scientist #1627, 25th August 1988 [link]

Kugelbaum wandered into a history lecture by mistake and, almost as quickly, but not by mistake, wandered out again. “1210 may well have been a dull year,” he said to himself, “but it’s an interesting number. The first digit gives the number of 0s in it, the next the number of 1s in it, the next the number 2s in it and so on, quite consistently, right up to the very last digit. And there are other such numbers too, such as 2020 and 3211000! Curiously, I can’t find one with six digits, though.”

As he sought vainly the room where he was to give his lecture on number theory he amused himself by calculating all the numbers having this property. “I wonder,” he remarked as he looked into broom cupboard, “if one were to take all the numbers having this property and add them together, what the result would be?”

What is the sum of all the numbers having the property that their first digit gives the number of 0s in the number, the next the number of 1s in the number, the next the number of 2s in the number and so on, consistently right through to and including the last digit of the number?

(Since 10, 11, 12 and so on are not digits, any such number containing more than 10 digits must have zeros in its 11th place and any other places after this).

Note: The original puzzle statement gave 211000 as an example, not 3211000.


Enigma 472: An omnidigital problem

From New Scientist #1623, 28th July 1988 [link]

“I have on a piece of paper,” said Ms Omnidigitalis to Mr Ffosby, “two proper fractions, F and f, not necessarily in their lowest terms. Of both F and f it is separately true that:

(a) Adding numerator to denominator gives 99999;
(b) Of the numerator and denominator, if one is not divisible without remainder by any of the numbers 2, 3, 4, 5, 6, 7, 8 or 9, then the other will be;
(c) The numerator and denominator between them use all the digits 0-9 once and once only;
(d) Neither the numerator nor the denominator begins with 0.”

“There must be about six such fractions,” remarked Ffosby. “Any more clues?”

“Yes. The numerator of F is double that of f.”

What is f in its lowest terms?

Enigma 467: Put out

From New Scientist #1618, 23rd June 1988 [link]

I have before me a machine which operates on integers. Turning the handle once takes the integer at the input, adds 1 to it and then divides the result by 2, providing only that this is possible without fractional result or remainder. The result is displayed at the output and automatically fed back into the input. If turning the handle would otherwise have produced a fractional result or a remainder, the handle of the machine refuses to turn.

I fed an integer N into the input. I turned the handle and found that the ultimate digit of the number output was the same as the ultimate digit of the number input. Intrigued, I turned the handle again and again. All in all I turned the handle 11 times until the ultimate digit of the 11th number output was no longer the same as the ultimate digit of N.

I cleared the machine and fed an integer A into the input. I turned the handle and found that the ultimate digit of the number output was not the same as the ultimate digit of the input number A. Put out, I turned the handle again and again. All in all I turned the handle 11 times. The ultimate digit of the 11th number output was one less than the ultimate digit of the penultimate number output.

What was the smallest possible value of: (a) N?; (b) A?


Enigma 463: Eights

From New Scientist #1614, 26th May 1988 [link]

It was a lovely day down by the river and I was in the mood for poetry or love. In fact I was just about to knock back another Pimms and look for Euthanasia when through the crowd a puzzling person from Pembroke broke in on my private bliss.

“You know,” he said, skipping the customary formalities, “that any power of 10 above or equal to 1000 can be represented as a sum of strings of 8s? For example, that 1000 = 888 + 88 + 8 + 8 + 8?”

“Yes …” I said, as a big girl in a straw hat trod on my foot. “Or 1000 = 88 + 88 + 88 + 88 + 88 + 88 + 88 + 88 + 88 + 88 + 88 + 8 + 8 + 8 + 8.”

“Yes. But the first example represents the number 1000 with the fewest 8s. And this fewest number of 8s is 8, which is itself a string of 8s, though admittedly a rather short one, consisting of just one 8.”

“What,” he went on, “is the next power of 10 such that the number of 8s used in representing it as the sum of the fewest number of strings of 8 possible, is itself a string of 8s?”

I paused to remove a fly floating in my Pimms.

“In mathematical language, then, you are saying: find the first integral value of n greater than 3, such that when you express the number 10n as the sum of the fewest number of numbers consisting of the digit 8 only, this fewest number of 8s used is itself a number consisting of the digit 8 only.”

“Precisely,” he grinned, as some chap rolled down into the water nearby and Lady Fanshaw burst out into horrible tinkling laughter somewhere near my left ear, “all in base 10, of course.”

What is the value of n?


Enigma 459: Stepped triangles

From New Scientist #1610, 28th April 1988 [link]

Enigma 459

Yehudi Everknott instructed a builder to make a patio in the form of a stepped triangle in the middle of his perfectly flat back lawn. The patio was to be made from a number of rectangular plane slabs, each having the same dimensions and alignment. The sides of each slab were to measure a whole and exact number of feet and were to be joined edge to edge with no gaps or overlap, to produce a stepped triangle whose two smaller sides were to be straight lines and whose hypotenuse was to be in steps of one slab. As if that were not enough, the perimeter in feet was to equal its area in square feet.

At first the builder, a Mr Zolyakar, who charged £11 per square foot, thought in terms of square slabs and produced an estimate based on the greatest number of square slabs that would fit Everknott’s conditions. Then he produced another estimate for the largest stepped triangle meeting Everknott’s conditions and using rectangular slabs. Again he charged £11 per square foot.

(a) For how much was his first estimate?
(b) For how much was the second?


Enigma 454: Stepped rectangles

From New Scientist #1605, 24th March 1988 [link]

Enigma 454

Oölith the Rational, on conquering the town of Major-Minor, the two parts of which are separated by a river, decreed that two piazzas be built, one (the larger of the two) in Major and one in Minor. They were to be stepped rectangles (see diagram) of square slabs, each measuring 1 groddly by 1 groddly. Each piazza was to contain a number of slabs equal to the perimeter in groddlies multiplied by the king’s age (an exact number of years).

The vizier explained to the grand mason appointed to this task: “A stepped rectangle is a plane array of square slabs laid edge to edge with no overlap. The sides of the figure are zig-zag: if you imagine walking around its perimeter clockwise, you must turn alternately left and right except at the four extreme corners, at each of which you must make exactly two consecutive right turns.”

The mason knew the king’s age (he was in his twenties) and realised that exactly and only two different stepped rectangles were possible which would fit the conditions.

How many slabs did he require to build:

(a) the Major piazza;
(b) the Minor piazza?


Enigma 450: A pentagonal problem

From New Scientist #1601, 25th February 1988 [link]

“I always remember my security number in the following way,” said the five-star general. “I think of the Pentagon and inscribe around its perimeter the digits from 0 to 9 using each one once and once only. Five of the digits end up on the corners and the other five equidistant between them.”

“But that can be done in too many ways to be of any use,” I protested weakly.

“Aha, and then there’s the clever bit. The sum of the three digits along any edge is the same for all five edges.”

“Isn’t that still too general, general?”

He looked crestfallen. “Well, the digits on the corners are either all odd or all even, I can never remember which.”

“That still leaves at least two possibilities,” I pointed out.

“Four actually,” he replied, “but that don’t mean a thing. Because what I do is imagine marching around the Pentagon. I pass the digits consecutively and write them down as I pass them. So I start by passing 9 and writing 9, and I stop only when I have a ten-digit number. Yeah, sure, I could walk around it clockwise or anticlockwise, and sure it makes a difference whether it’s odd numbers on the corners or even numbers, but I’m from Texas and the largest of the four possible numbers is my security number.”

What is his security number?


Enigma 446: Pocket money

From New Scientist #1597, 28th January 1988 [link]

The benefactor Lord Elpis was superstitious to a degree which surpassed mere triskaidekaphobia, shunning black cats and saluting magpies. Indeed, his superstition was more a form of sympathetic magic. He kept two watches, Tick and Tock. When Tick ran down he would wind Tock, so that Tick could rest and vice versa.

One of his many peculiarities related to money, which he only ever carried in his trouser pockets. His trousers had two pockets and two pockets only, and in these he would carry only those non-zero sums of money which could be split between the two pockets in such a way that the amount in his left pocket multiplied by the amount in his right pocket was exactly equal to the amount in the left and right pockets taken together.

Thus, for example, he could carry £6.25, as it was possible to put £5 of this in his left pocket and the remaining £1.25 in his right, since the product of these sums is equal to the sum of these sums.

Given that 100 pence equals £1 and that the penny is the smallest unit of currency:

(a) How many different sums can Lord Elpis carry?
(b) What is the most he can carry at any one time?


Enigma 438: Doubloons

From New Scientist #1588, 26th November 1987 [link]

Our gallant ship had been overrun by pirates just off Tortuga and their leader, the notorious Black Jake, was strutting about our decks among his jeering men tormenting the captives.

Black Jake swaggered through the smoke in my general direction. “They tell me you have a head for figures, landlubber,” he sneered, prodding me with a gnarled forefinger.

“Er yes,” I said, in what must have been one of my less distinguished utterances.

“Then solve this or walk the plank. In this purse I have doubloons and doubloons only; their number consists of four digits. If you double the number of doubloons and reverse the digits of the number so formed you obtain the same number of doubloons as there would be in the purse were you to add two doubloons to their number.”

By this time my head was swimming. But I knew that if I didn’t solve it on the double that worry would become a drop in the ocean.

How many doubloons were there in Black Jake’s purse?


Enigma 433: Double vision

From New Scientist #1583, 22nd October 1987 [link]

Professor Didipotamus had been working on the equation:


in which each letter stood for a single digit and B was a multiple of E.

“Oh dear,” he said, “that has too many solutions. For example: 76 = 493. Or, worse still, if A were 9, we could have 94 = 812 or 96 = 813.”

So saying, he scratched his head and put on his bifocals. To his surprise, the equation on his whiteboard now seemed to read:


“Now that’s the sort of equation I like,” he remarked to a flowering cactus. “It should have only one solution.”

Given that A, B, C, D and E all stand for different digits, that B is a multiple of E, and E is not 1, what number does ABCDE represent?


Enigma 429: Professor Quark

From New Scientist #1579, 24th September 1987 [link]

Professor Quark was standing in a queue at a cheese counter. “I seem to be in a rather stationary state,” he mused out loud. “This queue and my position in it have a special property. You see,” he explained to an imaginary observer, “if one person were to drop out of the queue ahead of me, the number obtained by dividing the number behind me by the number remaining ahead would be an integer or half an integer. If instead a person were to drop out of the queue behind me, then number obtained by dividing the number ahead of me by the number remaining in the queue behind me would also be either and integer of half an integer.”

Bearing in mind that a queue with, say, 3 in front and 4 behind is distinguishable from one with 3 behind and 4 in front, and assuming Quark’s calculations were correct:

(a) How many distinguishable queues satisfy Quark’s observation?

(b) What was the largest number of people, including Quark, that there could have been in the queue?


Enigma 425: Them thar’ Hills

From New Scientist #1575, 27th August 1987 [link]

“I am old,” said Mr Methuselah, “but not as old as the Hills. Did you know that if you add up the ages of all the Hills exceptin’ Mr Hill you gets his age? And did you know that if you multiply the ages of all the Hills except Mr Hill you get a number which contains ones only, and as many ones as there are Hills, not counting Mr Hill? Every Hill has a different age less than 100, and every Hill’s age in years is odd, exceptin’, of course, Mr Hill.”

I didn’t know this. How could I? I had only just arrived in Rome, Georgia, the knew nothing of the locality. But once he had told me it sure set me to wondering:

How old is Mr Hill? How old is Mrs Hill? And how old are the Hillocks?


Enigma 420: A princely sum

From New Scientist #1570, 23rd July 1987 [link]

The King of Zoz was asked by his son for 88,200 ducats to cover the latter’s gambling debts incurred at college.

“That is indeed a princely sum!” said the King, calling for his ornate coffer, the one containing single ducats only.

“How much is there in the old coffer of yours?” asked the Prince as two servants struggled with it it.

The father smiled indulgently but knowingly and replied: “If you were to multiply the number of ducats it now contains by the number of ducats would remain in it were I to remove 88,200 ducats, you would arrive at a perfect square.”

“There must be many numbers of ducats which fit those constraints,” said the son wistfully.

“Aye. And if you have the wit to deduce the number of different numbers of ducats there could be in the coffer consistent with my statement I shall know that you have learnt something and I shall pay your debt. If not, you can cover it yourself.”

Assuming there will be at least one ducat remaining in the coffer if the King removed 88,200 ducats, how many different possible numbers of ducats are there?

Enigma 496 is also called “A princely sum”.


Enigma 416: Short notice

From New Scientist #1566, 25th June 1987 [link]

I am making a noticeboard from a sheet of cork. In my search for some wood to back it, I came across two pieces having the same area as the cork, but different dimensions. To make the first piece fit, it would have been necessary to cut A feet off the cork and B feet off the wood, and to fit the second would have required C feet to be cut off the cork and D feet off the wood.

When I arrived at the timber yard I had forgotten the dimensions of my piece of cork. I remember only that, in measuring A, B, C and D, I obtained 1 foot, 2 feet and 4 feet only, with one measurement occurring twice. Which one occurred twice and in what order I obtained these measurements I forget.

All I can remember is that the cork measured a whole number of inches along each side and that none of its sides measured a whole number of feet.

Can you help me to deduce the size of wood I need to buy before the woodyard closes?

(Answers in inches, please: 1 foot = 12 inches).


Enigma 412: A triangular square

From New Scientist #1562, 28th May 1987 [link]

Enigma 412

Professor Kugelbaum, deep in thought and in a distracted state, wandered onto a building site. He saw a man laying equilateral triangular slabs on a plain flat area. Turning his keen mind from the abstract to the concrete, he asked the man with a sudden inspiration, “What are you doing?”

“I’m laying a town square.”

“But the angles aren’t right.”

“Well, it’s going to be a square in the form of an enormous equilateral triangle”, was the reply.

“I don’t call nine slabs enormous.”

“Ah”, said the workman, “first, I haven’t finished yet: I’ve just started at one apex. Secondly, if you look carefully, you’ll see that there are in fact 13 different triangles to be found in the pattern I’ve already laid [see diagram]. When I’ve finished there will be 6000 times as many more triangles to be found in the completed array.”

Kugelbaum’s mind began to tick over.

How many slabs will there be in the completed array?


This puzzle brings the total number of Enigma puzzles on the site to 1,100 (and by a curious co-incidence on Monday I posted Enigma 1100 to the site). This means there are (only!) 692 Enigma puzzles remaining to post, mostly from the 1990s. There is a full archive of puzzles from the inception of Enigma in February 1979 up to May 1987 (this puzzle), and also from September 2000 up to the end of Enigma in December 2013. Happy puzzling!


Enigma 407: Bug-in-a-box

From New Scientist #1557, 23rd April 1987 [link]

A collector was ordering a thin rectangular box to house insects captured in the field.

“Each of its edges must measure a whole number of inches”, he told the carpenter.

“Well, that leaves a lot of room for manoeuvre”, the other remarked.

“That’s exactly the point”, the collector said. “You see, they cling to the edges of the box for security, poor little mites, and they detest traversing the same edge twice … But though they are confined to the edges they can still dream of unconquerable space. In fact I don’t know which is more important, the volume or the length of the edges. You’d better make the volume in cubic inches equal to the sum of all the 12 edges of the box”.

“Well, that narrows is down a little”, said the carpenter.

“Oh dear, I hope not”, said the collector. “Please make it as big as you can consistent with these specifications”. So saying he rushed out, almost snagging his net on the door handle.

The carpenter produced the box just as he was bidden. Assuming bugs do refuse to traverse any part of an edge previously trodden by them, what is the furthest a captive bug can walk before it becomes bored?


%d bloggers like this: