Enigmatic Code

Programming Enigma Puzzles

Enigma 1244: All in one

From New Scientist #2400, 21st June 2003

Joe tries to maintain his daughter’s interest in logic by making up a puzzle for her to solve each weekend. Last weekend he gave his daughter a small bag of marbles and then arranged 9 egg cups in a 3 by 3 square. Each egg cup could hold up to a dozen marbles and her problem was to put as many in the centre cup as she could, leaving all the others empty. But she had to follow a rule.

If marbles were put into or removed from any one egg cup then the same number of marbles had to be put into or removed from all directly adjacent cups. For example, if one marble was place in, or taken out of, a corner cup, then one marble had to be placed in, or taken out of, each of the two cups directly adjacent to it.

Eventually Joe’s daughter managed to end up with marbles in the centre cup only.

How many marbles were in that cup?

Enigma 269: Transports of delight

From New Scientist #1416, 9th August 1984 [link]

Sheik Inbed the Terrible is in transports of delight, having just placed an order for some Cadillacs, more Mercedes and yet more Rolls Royces. If you take these three numbers of cars and add them together, you get the number of his wives. If, instead, you multiply them together, you get the number of his camels, which happens to be 3150.

No doubt you would like to know how many Rolls he has ordered. Well, do you know how many wives he has? No? Never mind — you could not deduce the number of Rolls, even if you did.

Let me just add, however, that, if you knew the number of wives and I threw in the fact that there are less than half that number of Rolls ordered, then you could deduce the exact number.

So how many Rolls has the terrible fellow ordered?

Enigma 1245: It’s a knockout!

From New Scientist #2401, 28th June 2003

Eight teams entered a knockout football competition. Extra time, where necessary, ensured that there were no draws. Four goals were scored in the final, but fewer than that in each of the other games. The scores in the two semi-final matches were the same. Illustrated below is part of the table of the total goals scored against and for each team.

Enigma 1245

In the entries show, digits have been consistently replaced by letters, different letters being used for different digits.

Which four teams got through to the semi-finals of the competition?

Enigma 268: Missing figures

From New Scientist #1415, 2nd August 1984 [link]

The following long division sum with most of the figures missing comes out exactly:

Enigma 268

Find the correct figures.

Enigma 1246: Triangle squares

From New Scientist #2402, 5th July 2003

My daughter Monica has been calculating the sums of the numbers 1, 2, 3, 4, … to give totals 1, 3, 6, 10, …, the so-called “triangular numbers”. She then showed me something she had written down (see diagram).

Enigma 1246

She pointed out that each of the rows was a three-figure triangular number and that the grid was symmetrical (with the first row equal to the first column, and so on). However, the leading diagonal gave 733, which is not a square. She wanted to construct another [grid] of the same type but with the leading diagonal a square.

Can you?

Enigma 267: Just one at a time

From New Scientist #1414, 26th July 1984 [link]

I have in mind a five-figure number. It satisfies just one of the statements in each of the triples below.

The sum of its digits is not a multiple of 6.
It is divisible by a number whose units digit is 3.
Its middle digit is odd.

The sum of its digits is odd.
It has a factor which is not palindromic.
It is not divisible by 1001.

It has two or more different prime factors.
It is not a perfect square.
It is not divisible by 5.

What is the number?

Due to industrial action New Scientist was not published for 5 weeks between 19th June 1984 and 19th July 1984.

This brings the total number of Enigma puzzles available on the site to 804, just over 45% of all Enigma puzzles published.

Enigma 1247: Recurring decimal

From New Scientist #2403, 12th July 2003

George has written down a proper fraction whose numerator and denominator each have four digits, and has calculated the corresponding decimal fraction, thus:

Enigma 1247

All the digits of the fraction and its decimal equivalent have been replaced by # marks. Moreover, the bar over the decimal expression indicates that its value comprises one decimal digit that is followed by a recurring decimal with a seven-digit cycle.

The numerator, the denominator and the non-recurring decimal digit include nine different digits.

If the numerator is a prime, what are the seven digits under the bar?

Enigma 266: Twelve trees

From New Scientist #1413, 7th June 1984 [link]

Enigma 266 The dots are very thin vertical trees, laid out on an endless square grid, with each tree a kilometre from its nearest neighbours. The two circles are Sue’s first attempts at drawing the smallest and the largest possible circles which enclose exactly 12 trees. The smaller has a radius of 1803 metres, the larger of 2061 metres. Given that the centres can be anywhere you like, that the radius must be an exact whole number of metres, and that the circles must not pass through any tree, can you do better? What in fact is:

(a) the smallest possible radius?
(b) the largest possible radius?

for such a circle enclosing exactly 12 trees?

Enigma 1248: Rows and columns

From New Scientist #2404, 19th July 2003

First, draw a chessboard. Now number the horizontal rows 1, 2, …, 8, from top to bottom and number the vertical columns 1, 2, …, 8, from left to right. You have to put a whole number in each of the sixty-four squares, subject to two conditions:

1. Rows 1, 2, 3, 4, 5, 6, 7, 8 are equal to columns 3, 6, 4, 4, 1, 6, 8, 6, respectively;

2. If N is the largest number you write on the chessboard then you must also write 1, 2, …, N-1 on the chessboard.

The sum of the sixty-four numbers you write on the chessboard is your total.

1. What is the largest total you can obtain?

If you look at your chessboard with the numbers on it you will find that every column is equal to a row. Now imagine we are considering chessboards of all sizes.

2. Is it possible to find an n×n chessboard, with a number in every square, so that every row equals a column, but there is at least one column which does not equal a row? If so, what is the smallest n for which it is possible?

Enigma 265: The parable of the wise fool

From New Scientist #1412, 31st May 1984 [link]

And in the evening it came to pass that the father summoned his four sons from the field and said unto them, “You have all found favour in my sight. My store is greater by two and twenty sacks of corn”.

Then spake Absalom to his father saying, “Father thou has told me that I did fill more sacks than any of my brothers. Give me therefore the reward, for I am the most worthy”. And the father rebuked Absalom saying, “Thy worth is no greater than thy brothers for each gave of his best, yet no two of you did fill the same number of sacks. Let instead the reward be to him who showeth the greatest wisdom”.

And he said unto Absalom, “Tell me how many sacks did each of thy brothers fill?” And Absalom knew not.

And he said unto Benjamin, “Thy sacks and the sacks of thy brother Caleb did together equal the sacks of Absalom. How many were the sacks of Caleb?” And Benjamin knew not.

And Caleb hearing these things yet did not know the sacks of Benjamin.

Then spake David saying, “Father, thou hast known me as a fool in the shadow of my brothers, yet if I may assume them to be perfect in the ways of logic and deduction then even I can give thee the numbers”. And he spake truly and was rewarded. And his father said: “Verily the fool who listens well with receive wisdom”.

If Benjamin didn’t bring back the fewest sacks, what was David’s answer?

This is the 800th Enigma puzzle to go up on the site. In total just under 45% of all Enigmas published are now available (there are about 980 to go).

Enigma 1249: Root routes

From New Scientist #2405, 26th July 2003

I have placed six different non-zero digits evenly-spaced around the circumference of a circle of radius 10 centimetres. I can now write down all sorts of lists of digits by the following process:

Start at one of the digits, write it down, move to a digit exactly 10cm or 20cm away, write it down, move to a digit exactly 10cm or 20cm away, write it down, etc etc. (You are allowed to revisit digits in this way).

I have just produced a list of six digits in this way. The six-figure number which is formed by this list turns out to be a perfect fourth power. I have then started again and produced a list of four digits. The four-figure number which is formed by this list turns out to be a perfect cube.

What is that cube?

Enigma 264: Courting couple

From New Scientist #1411, 24th May 1984 [link]

Here is a small test of reasoning, for which you need the Kings, Queens and Jacks from a pack of cards. As usual, cards of the same face value rank in the order Spades, Hearts, Diamonds, Clubs. All you have to do is select two cards, one at a time, so that all ten of these statements shall be true.

1. If the first card is black, the second is a Jack.
2. The first is a Queen, only if the second is a Diamond.
3. The first is a Heart, only if the second is black.
4. The first is a King, if the second is a Spade.
5. The first is a Club, if the second is a King.
6. The first is a Heart, if the second is a Heart.
7. If the higher is a Queen, the lower is a Heart.
8. The lower is a Jack, only if the higher is a Heart.
9. If the lower is red, the second is a Spade.
10. The higher is red, only if the first is not a King.

Bearing in mind that “if” does not mean the same as “only if”, can you specify the two cards in their right order?

Enigma 1250: Sheng-phooey

From New Scientist #2406, 2nd August 2003 [link]

A friend has hired a style consultant to help convert a few cowsheds into luxury homes. One the day we visited, the guru was in one of the rooms explaining how he had found the most harmonious position for the ceiling pendant light. He had drawn the rectangular ceiling to scale on a sheet of paper and cut it out. He had then taken the rectangle and made two mutually perpendicular cuts as shown in the figure: the resulting three separate shapes could then be rearranged to form a square of side representing 10 feet.

Enigma 1250

The shortest distance of point P on the ceiling from the nearest wall was 2 feet. This point was, we were told, the only possible position of the light fitting. I thought to mention the other equally valid positions, but it wasn’t my money buying this “expertise”.

What were the dimensions (length first) of the room?

Enigma 263: Multiple problem

From New Scientist #1410, 17th May 1984 [link]

In the following multiplication sum letters have been substituted for most the digits. The same letter stands for the same digit wherever it appears.

Enigma 263

Write out the whole multiplication sum.

Enigma 1251: Jigsaw of rectangles

From New Scientist #2407, 9th August 2003 [link]

It is day 10 of Frances’s holiday and she is cutting rectangles out of cardboard. She is cutting out every rectangle with whole number sides and area at most 10.

When she has finished she has 15 rectangles, which are:

1×1, 1×2, 1×3, 1×4, 2×2, 1×5, 1×6, 2×3, 1×7, 1×8, 2×4, 1×9, 3×3, 1×10, 2×5.

Frances then tries to fit the 15 pieces together to make a square, with no overlapping pieces and no holes. She finds it is impossible. In fact she tried a similar thing on day 2 of her holiday with all rectangles of area at most 2, on day 3 with area at most 3, …, on day 9 with area at most 9; on each day she found it was impossible to make a square.

Frances continues through her holiday, on day 11 with area at most 11, on day 12 with area at most 12, and so on. Each day she finds it impossible to make a square until one memorable day when she finds it is possible.

Which day of the holiday was that memorable day?

Enigma 262: Think of a number

From New Scientist #1409, 10th May 1984 [link]

I thought of an integer, added 1 and multiplied the total by the number I’d first thought of. I added 1 and multiplied the total by the number I’d first thought of. I added 1 and multiplied the total by the number I’d first thought of. Then I added 1. The final total was a perfect square. What is more, if I told you what that square was, then you’d be able to deduce the number I first thought of.

What was the number I first thought of?

Enigma 1252: Cards on the table

From New Scientist #2408, 16th August 2003 [link]

I have a square table top of side 36 inches and I have a collection of rectangular cards, each 5 by 7 inches. I have just placed some of the cards flat on the table top without any overlapping. I have done this in such a way that the only part of the table-top left uncovered is itself a square.

How many cards have I placed on the table top?

Enigma 261: Point in square

From New Scientist #1408, 3rd May 1984 [link]

It took some hours for the ZX Spectrum I received for Christmas to produce this pretty specimen of an integral-sided square, with a point P lying inside it at integral distances from three of the square’s corners.

If you use a computer, it will probably take you just as long to find another such specimen with smaller square-side. But without a computer, it is possible to find a solution in a fraction of the time. P must be inside the square, not outside or on the edge.

What is the length of the side of the smaller square and what are the distances PAPBPC?

Enigma 261

Enigma 1253: Votes and taxes

From New Scientist #2409, 23rd August 2003 [link]

The land of Votax has two tax systems, Rich and Poor. On the 1st March the people vote for which tax system they want and that is then used on the 1st April. There are 7 people on the island and they each have savings which only change according to the tax system. On 1st May 2003 the savings, in ascending order, were £5.10, £5.26, £5.30, £5.42, £6.14, £7.70, £7.90.

The tax systems are based on H, which is half of the highest savings. In the Rich system, if there are n people below H then we take £n from the poorest and give it to the richest, take £(n-1) from the next poorest and give it to the next richest, and so on, until we take £1 from the nth poorest and give it to the nth richest. The Poor system is the reverse of that, taking money from the richest to give to the poorest. People with savings below H vote for the Poor system and the others for the Rich system. In 2002 the Rich system was used.

Note that in 2004, H will be £3.95 and so all the savings will be on the same side of H; this has never happened before.

If the savings on 1st May 2001 were written in ascending order, what would the third and seventh amounts be?

Enigma 260: Willy Wonty

From New Scientist #1407, 26th April 1984 [link]

Mr and Mrs Wonty are having a spot of bother with the two-year school programme, which their son Willy is to follow. He is going to study exactly three subjects in each year.

He must have at least one year of chemistry and exactly one year of physics. If he does physics in the second year, he must do history in the second year too. If he does physics in the first year, he must do chemistry in the first year too. He cannot do chemistry in the first year, unless he does history in the second.

Then there’s English, which he must do in the first year, if he is to do chemistry in the second, and which he must do in the second year, if he does not do history in the first. The time-table stops him combining history and chemistry in the first year and also prevents a combination of history and English in the second.

Thank God for Religion! If all else fails, he can always take that.

Which subjects will Willy take when?


Get every new post delivered to your Inbox.