Enigmatic Code

Programming Enigma Puzzles

Tag Archives: by: Colin Singleton

Enigma 1112: Patio zones

From New Scientist #2268, 9th December 2000

George is building a patio, which will be covered using one-foot-square concrete slabs of seven different colours. He has divided the rectangular patio into seven rectangular zones, without any gaps.

Each zone will be covered by slabs of one colour, with five different colours appearing around the perimeter of the patio, and four different colours at the corners. The seven rectangular zones are all different shapes, but all have the same perimeter, which is less than 60 feet.

What are the dimensions of the patio that George is building?

This puzzle is referenced by Enigma 1221.


Enigma 1118: 2001 – A specious oddity

From New Scientist #2274, 20th January 2001 [link]

George is planning to celebrate the new millennium — the real one — by visiting Foula, the most remote of the Shetland Islands. It is one of the few places in the world where the inhabitants still live by the old Julian calendar rather than the now almost universal Gregorian calendar.

In order to correct the drift of the Julian calendar against the seasons, Pope Gregory decreed that in 1582, Thursday 4th October (Julian) should be immediately followed by Friday 15th October (Gregorian), and in order to prevent a recurrence of the drift, years divisible by 100 would henceforth only be leap years if divisible by 400. Previously all years divisible by four were leap years. Catholic countries obeyed immediately, others — apart from Foula — fell into line in later centuries.

While planning his visit George programmed his computer to print 12-month calendars for the required year, showing weekdays, under both Julian and Gregorian styles. But when he ran the program he was surprised to find that the two printouts were identical.

He then realised that he had entered the wrong year number — the Julian and Gregorian calendars for the year 2001 are not the same.

What is the first year after 1582 for which they are the same?


Enigma 1122: Chapter and worse

From New Scientist #2278, 17th February 2001 [link]

While waiting for a much-delayed train, George found himself trying to read a very boring book. He soon gave up and started counting its pages instead. Chapter 1 started on Page 1, and each subsequent chapter started at the top of a page. The boredom factor was enhanced by the fact that the length in pages of each chapter was equal to the chapter number multiplied by the length of Chapter 1.

With still no sign of the train, George proceeded to total all the page numbers in each chapter. Again, the totals for each chapter were exact multiples of the total for Chapter 1, but this time the multiples did not equate to chapter numbers. For the last chapter the multiple was a prime number, even though the chapter number was not.

How many pages were there in the book?


Enigma 1126: Enigmatic dice

From New Scientist #2282, 17th March 2001 [link]

George has been winning free drinks at his local pub using a trick with four non-standard dice. Each face of each die is marked with one of the numbers 1 to 9, not necessarily all different. One of the nine numbers does not appear on any die, but each die has the same total of its six faces.

George allows you to choose one die, then he chooses one of the others. The two selected die are thrown simultaneously, and the one who throws the smaller number buys the drinks. Draws are impossible.

His friends have discovered that if they choose the red die, George chooses the yellow — if they choose yellow, George chooses green — if they choose green, George chooses blue — and if they choose blue, George chooses red! George expects (statistically) to win exactly two throws in every three with any of these pairs of dice.

We can conveniently represent the markings on a die as a six-digit number, with the digits in ascending order. You can check that 334455 beats 222288 two-to-one, but George’s set does not include either of these dice. The red die includes at least one lucky seven. There is only one set of four dice which will do the trick.

List the six numbers for each of the four colours.


Enigma 1132: Phone back

From New Scientist #2288, 28th April 2001 [link]

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?


Enigma 1135: Perfect harmony

From New Scientist #2291, 19th May 2001 [link]

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?


Enigma 1140: A long, long road

From New Scientist #2296, 23rd June 2001 [link]

George lives in a long road in which the houses are numbered from one with no numbers missing. He has calculated that the total of all the house numbers less than his is equal to the total of all the house numbers greater than his.

George’s brothers, Dave, Ernest and Fred, live in shorter roads than George, but they can each make the same claim regarding house numbers. The brothers’ four house numbers have different numbers of digits.

Hearing this story, George’s drinking friend scribbled on a beer mat for a while, then he asked: “George, does your road have nearly 10,000 houses?”

“No, not nearly that many,” George replied.

How many houses are there in total in the four roads? And what answer would the man in the pub have given to that question before being corrected?


Enigma 1146: Units fore and aft

From New Scientist #2302, 4th August 2001 [link]

Reading an old question paper in Mathematical Challenge, a problem-solving competition in Scotland, George found the question:

“Which integer can be multiplied by 99 by appending a single digit 1 at each end?”

While struggling with this question, he discovered that 77 can be multiplied by 23 by adding 1 in front and 1 behind:

77 × 23 = 1771.

With rather more effort he found:

52631579 × 29 = 1526315791.

The answer to the Scottish challenge is: 112359550561797752809.

George eventually proved that 23 and 29 are the smallest prime numbers by which other suitably chosen numbers can be multiplied simply by adding ones fore and aft.

What is the largest prime number by which some other number can be multiplied using this trick?


Enigma 1149: Egyptian fraction

From New Scientist #2305, 25th August 2001 [link]

The Ancient Egyptians could not comprehend fractions with numerators greater than 1, such as 8/11. If required to divide 8 sacks of wheat evenly among 11 bakers, each could first be given 1/2 a sack, then from the residue each could be given 1/5 of a sack, but not as much as 1/4. With modern arithmetic we can use this logic to calculate that 8/11 = 1/2 + 1/5 + 1/37 + 1/4070.

There are several ways of representing 8/11 as the sum of reciprocals without including such unfriendly fractions as 1/4070. George’s friend Henry has discovered that 8/11 = 1/2 + 1/6 + 1/22 + 1/66, which he likes because the reciprocal denominators are all even divisors of his house number, 66. George has matched this achievement by expressing 8/11 as the sum of the reciprocals of a set of different odd divisors of his odd house number, which is less than 200.

What is George’s house number?


Enigma 1154: Funny money

From New Scientist #2310, 29th September 2001 [link]

After the Apathy Party swept into power in the General Election, George, its founder, realised one of the hazards of government: impractical proposals are liable to become law because no one has properly assessed the consequences. The latest is so bizarre that even the Apathy Party must reject it?

The Chancellor of the Exchequer thinks it would be fun to abolish the current coinage and mint just one denomination of coin and one of note. He has proposed an absurd pair of values, each a whole number of pence. George realises that although a large sum of money, such as £999.99, can be paid exactly in several different ways, there are precisely 10,000 amounts that can each be paid exactly using only one combination of the proposed notes and coins. Worse, there is a smaller, but still substantial, number of amounts that cannot be paid exactly using any combination of one or both of the denominations.

How many different amounts cannot be paid exactly?

See also Enigma 1194.

Thanks to Hugh Casement for providing a transcript for this puzzle.


Enigma 1158: Anti-Magic

From New Scientist #2314, 27th October 2001 [link]

George quickly solved the popular magic square puzzle which asks you to arrange the numbers 1 to 16 in a 4 × 4 grid so that the four rows. the four columns and the two diagonals all have the same sum — so he tried to be different. He has now found an “Anti-Magic Square”, using the numbers 1 to 16, but the ten totals are all different. They are in fact ten consecutive numbers, but in no particular sequence in relation to the square grid.

One of the diagonals in George’s square contains four consecutive numbers and the other contains four prime numbers, each in ascending numerical order from top to bottom.

One row contains four numbers in ascending numerical order from left to right.

What are those four numbers?

Enigma 8 was also about anti-magic squares.


Enigma 1161: Shifty division

From New Scientist #2317, 17th November 2001 [link]

In a previous Enigma, George asked you to find the smallest number which can be multiplied by four simply by moving the last digit to the front. The answer is 102564 × 4 = 410256. In fact, 102564 is the smallest number which can be multiplied by any integer by moving its last digit to the front.

George is now trying to find numbers which can be divided exactly by some integer (any integer greater than one) simply by moving the last digit (which must not be zero) to the front. He has found two solutions to this puzzle and checked them on his eight-digit calculator. He is now looking for another.

What is the smallest number which George has not yet found which can be divided by some factor using this trick?


Enigma 1165: Bull’s-eye

From New Scientist #2321, 15th December 2001 [link]

The darts players at George’s local have devised a seeding system for themselves. Each has determined the number of darts he needs to throw, on average, in order to hit the Bull once. This is his rating — the lower the better. Thanks to remarkable foresight in their parents’ choices of names, the seedings proceeded alphabetically from Alan at No. 1 to Zak at No. 26, with no duplication of initial.

Fred and George met in the pub recently and decided to throw alternately, one dart at a time, until one hit the Bull. The other would then pay for the drinks. Although Fred is the more accurate darts player, they calculated from the ratings that if George threw first they would each have an even chance of winning the sudden-death game.

Duly refreshed, they then calculated from the ratings that this would be an even-money game for any pair of players who are adjacent in the seedings, provided the lower seed throws first. But if Zak played the game against Alan and threw first, his chance of winning would be exactly 10 per cent.

What is George’s rating?


Enigma 1169: Snookered

From New Scientist #2325, 12th January 2002 [link]

George lives not far from the Crucible Theatre, where the annual World Snooker Championship has been held for the past 25 years. Each year 32 players compete in a straightforward knockout tournament to determine who is the champion.

George, and his brother Fred, have entered a less prestigious tournament at their local pub. Since they cannot be certain that the number of entrants will be a power of two, lots will be drawn to see who is awarded byes in the first round. The tournament will then continue as a knockout, also drawn at random.

While waiting for the draw to be made, George calculated the chance that he will at some stage have to play against his brother, assuming all the players are of equal ability. It is exactly one in ten.

How many players entered the tournament?


Enigma 1172: Plant a tree

From New Scientist #2328, 2nd February 2002 [link]

George’s local council celebrated National Plant a Tree Year by planting four saplings in a public park. Unfortunately, a few nights later, vandals dug up one of the trees and cleared the ground leaving no evidence of where the tree had been. George has been asked to help.

The Mayor explained that the straight-line between the six pairs of trees had been carefully measured so that there were only two different distances. With three trees remaining where they had been planted, he asked it George could work out the original position of the fourth.

“No,” George replied, “I have identified four possible positions and I am still thinking”.

How many possible positions were there?


Enigma 1177: Photocopy

From New Scientist #2333, 9th March 2002 [link]

George drew a rectangle on a piece of paper and marked a dot 2 centimetres to the right and 1 centimetre up from the bottom left hand corner, as measured by perpendicular grid lines. (Assume the dot has zero size).

He then made a photocopy, reduced in scale so that the length of the diagonal of the copied rectangle equalled the short side of the original. He rotated the copy and placed it so that three of its corners lay on the sides of the original as shown.

Enigma 1177

George was then surprised to find that the copy of the dot coincided exactly with the original.

What were the dimensions of the original rectangle?


Enigma 1181: Pandigitals

From New Scientist #2337, 6th April 2002

George has been investigating pandigital numbers, which he defines as 10-digit numbers with no leading zero, containing the digits 0-9 once each. The largest pandigital number is 9876543210. Since it ends in 0 it is clearly divisible by 2 and 5, giving quotients 4938271605 and 1975308642 – both pandigital!

Inspired by this discovery, he set out to list, for each possible multiple, the largest pandigital number which is an exact multiple of another pandigital number. The solutions for 4 and 8 can be found by small-scale number juggling; the others require a more systematic approach.

What is the smallest number in George’s list of largest pandigital multiples?

Thanks to Hugh Casement for providing a complete transcript for this puzzle.


Enigma 1190: Triple duel

From New Scientist #2346, 8th June 2002 [link]

In an earlier incarnation, George fought a “duel” with Ernest and Fred. Ernest was a crack shot, 100 per cent certain to hit his target. Fred had a 75 per cent chance and George only 60 per cent. They agreed to fire one shot at a time in rotation, George (the weakest shot) first, then Fred, then Ernest, until two were dead. Each could aim where he pleased.

If each adopted his best strategy, who was most likely to survive and what was his percentage chance of survival?


Enigma 1193: 1,000,000!

From New Scientist #2349, 29th June 2002 [link]

George has been explaining to his young son the concept of factorials, which are denoted by an exclamation mark. The factorial of three, denoted 3!, is 1 × 2 × 3 = 6. The factorial of 10 (10!) is 1 × 2 × 3 × 4 × 5 × 6 × 7 × 8 × 9 × 10 = 3,628,800.

“In that case, Dad, the factorial of one million (1,000,000!) must be a very large number.”

“Indeed so — it has more than five million digits, ending with a long string of zeros.”

How many zeros?

This Enigma appeared in the styling that was used for the remainder of Enigma puzzles, up to December 2013.


Enigma 1198: Rightly similar

From New Scientist #2354, 3rd August 2002 [link]

George, Fred and Harry have been doodling with pencil and paper — each has drawn a right-angled triangle. The three triangles are similar — that is to say all the same shape but different sizes.

Although they are different sizes, each of the three triangles has one side measuring exactly 10 cm.
 None of the other sides are integers. One of the non-integer sides of George’s triangle is the same length as one side of Fred’s, and the other non-integer side of George’s triangle is the same length as one side of Harry’s triangle.

One side of Fred’s triangle has no exact equal in the other two triangles, and the same is true of one side of Harry’s triangle. Of those two sides, Harry’s is the longer.

How much longer?