# Enigmatic Code

Programming Enigma Puzzles

## Enigma 967: Prime cubes

From New Scientist #2122, 21st February 1998

George has 27 small blocks which have been identified with 27 different prime numbers — each block has its number on each face. He has assembled the blocks into a 3×3×3 cube, as shown. On each of the three visible faces, the nine numbers total 320 — but this is not true of the three hidden faces.

George remembers that when he bought the blocks they were assembled into a similar 3×3×3 cube, but on that occasion they showed the same total on each of the six faces, this being the smallest possible total if each block has a different prime number.

What was the total on each face when George bought the blocks?

[enigma967]

## Enigma 985: 57 varieties

From New Scientist #2140, 27th June 1998 [link]

George has invested his savings in gold — a circular chain of eight linked gold rings. The drawing is deceptive, because in fact the rings are all different sizes, although each is a whole number of ounces in weight — the total is 57 ounces.

The chain has been designed so that the first time that George wishes to sell some of his gold, he can remove any whole number of ounces from the chain, either as a single link, or as a chain of linked rings.

Given that there is no 3-ounce ring, nor a 6-ounce ring, list the weights of the eight rings in order, starting with the two smallest.

[enigma985]

## Enigma 994: Lake land

From New Scientist #2149, 29th August 1998 [link]

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 997: Building sites

From New Scientist #2152, 19th September 1998 [link]

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 1009: Squared square

From New Scientist #2164, 12th December 1998 [link]

The diagram shows the simplest solution to the classical problem of dissecting a square into a number of smaller squares all with sides which are integers, no two the same. Unfortunately, the dimensions (several of which are prime numbers) have been deleted.

By studying the diagram with care can you determine the side of the outer square?

[enigma1009]

## Enigma 1024: Regal progress

From New Scientist #2180, 3rd April 1999 [link]

George is whiling away some time contemplating a chessboard. He has placed a King in the bottom left square and proposes to transfer it by a sequence of moves to the top right square. A King can, of course, move only one square at a time, either horizontally vertically or diagonally. In order to keep this process finite, however, George has decided to allow only three different moves — one square forward (upward), one square to the right, or one square diagonally up-right.

Even with this restriction, there are many ways of transferring the King to the diagonally opposite corner. It could proceed up the left-hand side then across the top. Or along the bottom then up the right-hand side. Or diagonally straight across the middle. Or any one of a myriad of zig-zag routes.

George’s attempts to identify all possible routes were witnessed by his small son.

“There must be thousands of ways of getting there, dad.”

“No, son, there can only be a few dozen.”

Who is right — and exactly how many different routes are there?

[enigma1024]

## Enigma 1031: Security

From New Scientist #2187, 22nd May 1999 [link]

George’s new office has a security lock in which you have to key in a series of digits — all different — before you can open the door. Unfortunately, George is having difficulty committing this security number to memory.

So far, he has memorised a number comprising a selection of different digits from the security number. He has made a note of the memorised number on the memo sheet on which he was given the security number.

After studying the sequence yet again, he absent-mindedly left the memo lying around his house. When his wife found the piece of paper bearing just two numbers, she thought George has been trying to devise an “Alphametic” Enigma for New Scientist. Just for fun, she multiplied the numbers together and found that the product was a seven-digit number in which all the digits are the same.

What is George’s office security number?

[enigma1031]

## Enigma 1036: Multiple shifts

From New Scientist #2192, 26th June 1999 [link]

George’s young son has been playing with numbered cards and has discovered an interesting curiosity. Having placed six cards on the table to show the number 179487, he then moved the right-hand card to the left to form the number 717948. A quick check on his calculator confirmed that this number is exactly four times the first number.

George congratulated his son on this discovery, and then challenged him to find the smallest number which can be multiplied by four simply by moving the last digit to the front.

Can you find this number — and the smallest number that can be multiplied by five in similar fashion?

[enigma1036]

## Enigma 1039: Mirror, mirror

From New Scientist #2195, 17th July 1999 [link]

George has fitted two mirrors inside a rectangular box, the first on one of the long sides, and the other across a diagonal. He shines a narrow beam of light through a small hole which he has drilled through the side of the box and the mirror on that side. It enters perpendicular to the side of the box, is reflected five times by the mirrors and emerges perpendicular to the end of the box through another hole, as shown.

The box is exactly one metre long. You can calculate the width if you wish, but that is not George’s problem. He wants to know how far the beam travels while it is inside the box.

Can you help him?

[enigma1039]

## Enigma 1041: Lucky sixes

From New Scientist #2197, 31st July 1999 [link]

George’s lucky number is six. After extensive number-crunching he has discovered that exactly half of all the numbers from 1 to his telephone number (inclusive) contain at least one six and that his telephone number is unique in possessing this property. George has done the hard work — all you have to do is deduce his telephone number, which has fewer than eight digits.

[enigma1041]

From New Scientist #2199, 14th August 1999 [link]

My late grandfather was born on a fine summer Sunday, several decades ago. His sixth, twelfth and eighteenth birthdays were also on Sundays, as was his birthday in 1994.

How old would Grandad have been on his birthday in 1999 if he had survived?

[enigma1043]

## Enigma 1047: Friday the 13th

From New Scientist #2203, 11th September 1999 [link]

Someone has told George that the 13th of a month is more likely to be a Friday than any other day of the week, but he is not sure whether he should believe it.

This year, 1999, the date Friday the 13th occurs only once, in August. Last year, 1998, it occurred three times, in February, March and November. It is clearly somewhat irregular.

If George choose a random month in a random year on the Gregorian calendar, what is the probability that it will include Friday the 13th? Please give your answer as a fraction in its lowest terms.

[enigma1047]

## Enigma 1053: Home truths

From New Scientist #2209, 23rd October 1999 [link]

George was being very secretive about his new house number — I had only established that it has two digits. After I had bought him a pint or two, he agreed that I could ask some questions, to each of which he would answer simply yes or no. I asked the following:

1. Is your house number the sum of two different non-zero perfect squares?

2. Is it the sum of two different prime numbers?

3. Is the sum of its digits even?

4. Is your number greater than 70?

George dutifully answered my questions, and I was crestfallen. “I cannot deduce your number”, I admitted, “but if you allow me one more question I can be certain of doing so”.

George reluctantly answered my fifth question, whereupon I boldly declared his house number — only to be rebuffed again.

“Wrong”, he said — but then sheepishly admitted that, in his slightly inebriated state, he had given the wrong answer to just one of my questions. When he told me which one, I jubilantly realised that I should not have needed a fifth question to identify his number.

What is George’s new house number?

[enigma1053]

## Enigma 1064: Low score draw

From New Scientist #2220, 8th January 2000 [link]

You play this game by first drawing 20 boxes in a continuous row. You then draw a star in each box in turn, in any order. Each time you draw a star you earn a score equal to the number of stars in the unbroken row [of stars] that includes the one you have just drawn.

Imagine that you have already drawn eleven stars as shown below, and you are deciding where to place the twelfth.

Drawing the next star in box 1 would score only 1 point, in box 11 it would score 2 points. A star in box 2, 5 or 6 would score 3 points, and in box 9, 12 or 19 it would score 4 points. Drawing the star in box 16 would score 6 points.

Your objective is to amass the lowest possible total for the 20 scores earned by drawing the 20 stars.

What is that minimum total?

#### News

This puzzle completes the archive of Enigma puzzles from 2000. There are now 1169 Enigma puzzles available on the site. There is a complete archive from the beginning of 2000 until the end of Enigma in December 2013 (14 years), and also from the start of Enigma in February 1979 up to January 1988 (10 years), making 24 years worth of puzzles in total. There are 623 Enigma puzzles remaining to post (from February 1988 to December 1999 – just under 11 years worth), so I’m about 62% of the way through the entire collection.

[enigma1064]

## Enigma 1076: Last posts

From New Scientist #2232, 1st April 2000 [link]

George has a small field adjacent to his new house, in which he intends to build an ornamental lake. The field is triangular with sides conveniently 4, 7 and 8 times the length — about 12 feet — of the job lot of fence rails he has bought from the local builders’ merchant. He has set the required 19 posts evenly spaced around the perimeter and built the fence.

To define the lake, George has stretched three lengths of rope, each from one corner post to the last post before the corner (working anticlockwise) on the opposite side of the field. The enclosed triangle will be the lake, the surrounding area grassland. The whole field measures two “ares” — an “are” being a metric unit of area equal to 100 square metres.

What is the area of the lake?

[enigma1076]

## Enigma 1087: Egyptian triangles

From New Scientist #2243, 17th June 2000 [link]

George has made a number of spinners for his children to select numbers when playing board games. Each has a circular disc divided into a number of equal sectors. He has made several discs of various sizes and with various numbers of sectors.

George’s son has discovered that three of the discs will fit together so that the marked radii form a triangle (shaded in the diagram) which includes just one sector on each disc.

Further research revealed that several other sets of three discs of suitable sizes and numbers of sectors can be used for form triangles of various shapes in this way, always including just one sector on each disc. George has found one set in which two of the discs have different prime numbers of sectors.

How many sectors are marked on the third disc of this trio?

[enigma1087]

## Enigma 1102: The Apathy Party

From New Scientist #2258, 30th September 2000 [link]

George called a meeting to inaugurate the National Apathy Party, open to anyone who has never voted in a General Election. He hopes to be the next Prime Minister. The turnout was phenomenal, but he managed to seat them all in Wembley Stadium (capacity 80,000). George proposed that the President and the Committee should be chosen by chance, rather than by ballot. The delegates had been allocated sequential membership numbers of arrival — George, of course, being No. 1. He proposed that one number be chosen at random by the computer — that member would be the President. All members whose numbers divide exactly into the President’s number would be on the Committee. Apathy reigned — this totally undemocratic procedure was agreed.

The computer produced an odd membership number for the President and the number of committee members, including George and the President, was an odd square greater than 10.

What was the President’s membership number?

[enigma1102]

## Enigma 1108: Every vote counts

From New Scientist #2264, 11th November 2000 [link]

George was nominated for president of the Golf Club. There was only one other candidate, and the president was elected by a simple ballot of the 350 members, not all of whom in fact voted.

The ballot papers were taken from the ballot box one at a time and placed in two piles — one for each candidate — with tellers keeping a count on each pile.

George won (what did you expect?), and furthermore his vote was ahead of his opponent’s throughout the counting procedure.

“That must be a one-in-a-million chance,” said the demoralised loser.

“No,” said George. “Now that we know the number of votes we each received, we can deduce that the chance of my leading throughout the count was exactly one in a hundred.”

How many members did not vote?

[enigma1108]

## Enigma 1112: Patio zones

From New Scientist #2268, 9th December 2000 [link]

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.

[enigma1112]

## 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?

[enigma1118]