Enigmatic Code

Programming Enigma Puzzles

Enigma 769: Magic square

From New Scientist #1924, 7th May 1994 [link]

In this magic square, each letter corresponds to the same digit wherever it occurs. There are nine different digits in the square. Each row, column and diagonal adds up to the same value. One final clue, F is larger than D.

What is the magic square?

No setter is given for this puzzle.

[enigma769]

BrainTwister #19: Angular arrangements

From New Scientist #3490, 11th May 2024 [link] [link]

A regular polygon is a shape with at least three straight sides where all the sides are the same length and all the interior angles are equal.

Knowing that a full turn is 360° and the angles in a triangle add up to 180°:

(a) Can you use this diagram to work out the size of the interior angles in this regular pentagon? Hint: an interior angle is made up of two adjacent angles from the outer corners of the triangle.

(b) Can you use the same idea to find a general way to calculate the interior angle of any regular polygon?

It is possible to arrange regular polygons around a point so they meet without leaving any gaps. Below is one such arrangement, using squares and equilateral triangles:

There are other ways to arrange regular polygons so they meet exactly at a point.

(c) How many can you find?

(d) What is the maximum number of sides a polygon in such an arrangement can have?

[braintwister19]

Enigma 767: Safety in numbers

From New Scientist #1922, 23rd April 1994 [link]

Harry’s safe has a combination lock, with the usual dial with divisions marked round its edge from 0 to 99. Security rules forbid him to write down the combination, which he is expected to memorise. He has a poor memory for figures, so he can seldom remember it, but he can remember that it has four 2-digit numbers and one 1-digit number in sequence, and that if the sequence of numbers is strung together, the digits of the resulting 9-digit number are all different. He can also remember that if he subtracts his room number from that number, the result is a perfect square; of which the square root is a perfect cube; of which the cube root is his room number. He would not of course tell you all this, because he knows that it would enable you to work out the combination.

Reminding himself of his room number (which is on his door!) he can work out the combination in a few minutes, even without his pocket calculator (which reduces the time to mere seconds). He thus avoids the ignominy of having to plead with Security to open the safe for him.

You may take rather longer than Harry to work out the combination; but if I tell you that the sum of the digits of the cube is equal to its cube root, it could help cut the time.

What is the combination (the five separate numbers in sequence)?

[enigma767]

BrainTwister #18: The arithmetical two-step

From New Scientist #3489, 4th May 2024 [link] [link]

You must take two steps to get from a given number to make 10. Each step must change the number by adding, subtracting, multiplying by or dividing by a number from 1 to 9. (Multiplying or dividing by 1 isn’t allowed as it doesn’t change the number).

For example, starting with 35, one way would be to first divide by 7 then add 5.

(a) Can you take two steps to get from 42 to 10?

(b) Is it possible to get to 10 in two steps from all the numbers 11 to 30?

(c) And can you find a two-digit number for which there is no way to get to 10 in two steps?

[braintwister18]

Enigma 774: Sting in the tail

From New Scientist #1929, 11th June 1994 [link]

In the above division sum sixes and zeros have been inserted wherever they appear. X stands for any digit, excepting 6 and zero but not necessarily the same digit throughout.

Find the value of the divisor XX.

[enigma774]

BrainTwister #17: Semi-one numbers

From New Scientist #3488, 27th April 2024 [link] [link]

When you count up to 2, exactly half of the numbers contain the digit “1”. We can use the term “semi-one numbers” to describe numbers with this property.

(a) The same is true of a number between 15 and 20. Which one?

(b) What is the next semi-one number after that?

(c) Could there be infinitely many such numbers?

The setter is given as: “Colin Wright (with thanks to Adam Atkinson)”.

[braintwister17]

Enigma 773: Duodecimal

From New Scientist #1928, 4th June 1994 [link]

Two warnings about the sum shown here: the first is that it is a sum in base 12 throughout; the second is that in the bottom line the first O is the letter O (since no number starts with a zero), bit the subsequent O’s may be the letter O or the digit zero and the I may be the letter I or the digit one. Elsewhere O is the letter O wherever it appears and the I in FIVE is the letter I. Each letter stands for a different digit and the same letter represents the same digit wherever it appears.

If you want to have a chance of winning the tenner prize, please send in the value (in base 12) of FIVER.

[enigma773]

BrainTwister #16: Order, order!

From New Scientist #3487, 20th April 2024 [link] [link]

(a) Arrange the digits 1-9 in a line so that each pair of adjacent digits differs by either 2 or 3.

(b) Arrange the digits 1-9 in a line so that each pair of adjacent digits sums to a prime number.

(c) Now arrange the digits 1-9 in a line so that each pair of adjacent digits (when read as a two-digit number) appears in the times tables from 1 × 1 up to 9 × 9.

[braintwister16]

Enigma 772: Have you seen the trailer?

From New Scientist #1927, 28th May 1994 [link]

My friend was towing a small open trailer behind his car when the tow bar snapped. Luckily the trailer was light, so he turned it upside down and put it (like a hat) on the roof of his car. Consequently traffic behind could see his number plate twice, once on the car and once (upside-down) on the trailer. Amazingly, despite the inversion, both looked the same.

Being a British car, the number plate consisted of a letter, three digits and three letters (the first of the three letters not being I, O, S or Z for fear of confusing it with a digit).

The three digits were different and formed a three-figure number which was not a prime, not the sum of two primes, and not the difference of two primes.

What was the full number plate?

Note that by May 1994, the first letter (indicating the year of registration) had got as far as L, and the letter I was not used.

[enigma772]

BrainTwister #15: Domino strips

From New Scientist #3486, 13th April 2024 [link] [link]

There are three ways to cover a 3 × 2 grid with dominoes.

How many ways are there to cover a 4 × 2 grid? What about a 6 × 2 grid?

Can you find a pattern that would help you work out the number of different ways dominoes can be used to cover any n × 2 rectangle?

[braintwister15]

Enigma 771: Cross the island

From New Scientist #1926, 21st May 1994 [link]

The map of the island shows the two ports, West and East, and the system of one-way roads — all traffic runs from west to east. The numbers show how many lorries are allowed along each road per day.

The island walking club wished to walk from the south [coast] to the north [coast] of the island. Each road has a toll bridge allowing walkers to cross it. The numbers on the map also indicate the toll for crossing each bridge. However the toll is only charged when a road is crossed from south to north — that is, when traffic is going from the walkers’ left to their right.

(a) What is the maximum number of lorries that can go from West to East in a day?
(b) What is the minimum cost the walkers have to pay if they choose their route carefully?

[enigma771]

BrainTwister #14: Factor graphs

From New Scientist #3485, 6th April 2024 [link] [link]

To construct a factor graph, we dot numbers around a page and draw lines between pairs where one is divisible by the other. Start by writing the numbers 1 and 2, and join them with a line – since 2 is divisible by 1. Then write 3 and join it only to 1 (since 3 is divisible by 1 but not 2). The number 4 would connect to 1 and 2 but not 3, and so on. The connecting lines need not be straight.

Can you continue adding numbers and connecting them to their factors until you have all the numbers from 1 to 10, but without any of the lines crossing anywhere? (You may need to redraw if you get stuck).

How many more numbers can you add before this becomes impossible?

If you don’t include the number 1 in your graph and instead start from 2, how many numbers can you add without creating lines that cross?

[braintwister14]

Rudolphogram #1

Find the smallest perfect square with exactly 2 zeroes, 2 ones, 2 twos, …, 2 nines.

The perfect square may not start with a zero.

This weeks bonus puzzle was suggested by new contributor ruudvanderham.

[ruud1]

Enigma 770: Long-distance calls

From New Scientist #1925, 14th May 1994 [link]

My telephone has a push-button dialling system in which the digits 1 to 9 are set out as shown above.

While using those buttons to telephone my friend Chris recently, I noticed that her six-digit telephone number had some interesting properties. It was an odd perfect square which used six different digits, and no two digits adjacent in her phone number were adjacent (horizontally, vertically or diagonally) on the telephone.

What is Chris’ phone number?

[enigma770]

BrainTwister #13: Number Venns

From New Scientist #3484, 30th March 2024 [link] [link]

Numbers 1–30 are put in circle A if they are part of group A, in circle B if they belong to group B, in the intersection between if they are part of both A and B, or outside the circles if they don’t belong to either A or B. What are groups A and B for each diagram below (not all numbers have been placed yet)?

Only one of these diagrams can have another number added to the overlapping section using these rules.

Which diagram is it? And what is that number?

[braintwister13]

Sphinx Cryptarithm #7

From Sphinx Magazine, February 1933

A printer, setting up the division shown above, found that he had only type numbers 7 and 0 which he put in their respective places, and two A‘s, which he used to substitute for a certain digit that appears twice in the dividend; but this same digit was next replaced by asterisks in all other parts of the division. The divisor is equal to the quotient.

Reconstruct the division sum.

[sphinx7]

Enigma 778: Trying triangle

From New Scientist #1933, 9th July 1994 [link]

Put a digit into each circle and read each side of the triangle clockwise, as a three-figure number. (For example, if I put a 2 in the top left-hand corner and continued, clockwise, 4, 6, 1, 4, 9, then the three-figure numbers would be 246, 614 and 492: notice that 492 is a multiple of 246, but 614 isn’t).

Your job is to choose the digits so that the second and third three-figure numbers are different multiples of the first three figure number.

What are the numbers in your triangle (clockwise from the top left-hand corner)?

[enigma778]

BrainTwister #12: Factorial factory

From New Scientist #3483, 23rd March 2024 [link] [link]

Mathematicians write 9! to represent the number “9 factorial”, which means 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 362,880.

How many zeros will 10! end with?

How many zeros will 25! have at the end? (Careful, the answer isn’t five.)

How many zeros will 1066! finish with?

[braintwister12]

Sphinx Cryptarithm #1

From Sphinx Magazine, January 1933

Reconstruct the multiplication, in which all the A=3 are given:

Each letter stands for the same digit whenever it appears, and different letters stand for different digits. A question mark can be any permissible digit.

[sphinx1]

Enigma 777: An odd multiplication

From New Scientist #1932, 2nd July 1994 [link]

In the multiplication above, the digits have been replaced by letters and asterisks. Different letters stand for different digits but the same letter always stands for the same digit whenever it appears while an asterisk can be any digit.

[What is the numerical result of the multiplication?]

[enigma777]