# enigma

## Enigma 1438 – Soccer Stats

set by Susan Denham

### Question

In a league of five teams, each team plays each of the others once a season. Below is a league table at the end of last season. Three of the numerical entries are incorrect.

Whats are the scores in Arnsley’s four games?

 Won Drawn Lost Goals for Goals against Arnsley 2 1 1 2 2 Boldham 3 1 0 2 1 Cleeds 1 3 0 1 0 Drochdale 1 2 1 1 1 Erby 1 0 3 1 3

## Enigma 1437 – Two Squared

set by Richard England

### Question

Harry and Tom each replaced each asterisk with a digit in such a way that the three numbers that could be read across and the two numbers that could be read down were five different perfect squares each of which consisted of three different digits (with no leading zero). Tom did not use any of the 3-digit squares that Harry used.

Which three 3-digit squares (of three different digits with no leading zero) did neither of them use?

First lets get all the 3 digits perfect squares (of which there are 13). They are as follows:

169, 196, 256, 289, 324, 361, 529, 576, 625, 729, 784, 841, and 961 (corresponding to squares of integers 13 – 31)

We could just put these numbers in the format and test them, so that’s what I did first.

After some trail and error I came upon a solution.

These two worked fine but wait. I turns out there are three possible ways of arranging the numbers.

and

After comparing all three of these we can see that they only use the same 10 squares out of the thirteen. So the three digits that the were not used turned out to be 324, 729, 784. And just for the hell of it, here’s a graphic for that too.

Oh the fun. We can only hope they’re going to get harder some time soon.

(On a side note, as I don’t always get the time early in the week to solve the puzzles as they are set so instead of holding back posting the complete question/solution when I have, I’m going to post up the question when I get them – usually Thursday/Friday – and update them when I’m happy I have a solution. If anybody fancies a crack at them please feel free.)

## Enigma 1436 – One More Step

Here’s this weeks problem:

Consider the following set of numbers:

1, 3, 7, 13, 21…

Send in the following:

a) The 600th member of the series

b) A member of the series above the first with less than five digits which is a perfect cube

c) A member of which is a five-digit palindrome which can also be read as a binary number

d) The smaller of the two consecutive members which are 1000 apart

Oh the joys. Yet another one that can be solved with a brute force method.

First we have to find out an how the sequence is generated. Looking at it carefully we can see it increments first by 2, then 4, 6, 8… To generate this sequence we do simply this: (n-1) * n + 1

### A – 600th member

To calulate this just set n to be 600. This gives us: 599 * 600 +1 = 359401

### B – perfect cube first with less than 5 digits.

Perfect cubes is simply the third power of an integer. To solve this we need to get all the perfect cubes with up to 4 digits and compare them against the members of the series. Lets do it with some php. First the cube array.

\$cubesArray = array(); for(\$a = 2; \$a <= 21; \$a++) { \$cube = \$a*\$a*\$a; array_push(\$cubesArray,\$cube); }

We know that the cube of 21 is the largest perfect cube with less than 5 digits so we only need the cubes up to there. No we need the corresponding array for the series and then loop through them and compare.

\$seriesArray = array(); for(\$b = 1; \$b <=600; \$b++) { \$value = (\$b-1) * \$b+1; array_push(\$seriesArray, \$value); } foreach (\$cubesArray as \$currentCube) { if (in_array(\$currentCube, \$seriesArray) { echo ‘Perfect Cube in Series: ‘.\$currentCube; break; } }

From this we get the answer to be 343

### C – The palindrome

This is relatively simple. The two contraints of it being the number being a palindrome, 5 digits and being able to be read as a binary leave us with only 4 options, 10001, 10101, 11011, 11111. Of these, a little bit of trial and error, leaves us with the answer as 10101. Simple

### D – consective 1000 apart

Oooo. Harder. No, well not really. We can do this again with a simple bit of php.

for (\$c = 0; \$c <=599; \$c++) { if((\$seriesArray[\$c] + 1000 == \$seriesArray[\$c+1]) { echo ‘the lowest consecutive member is: ‘.\$seriesArray[\$c]; break; } }

This spits out the answer 249501.

So to recap my answers are as follows:

• a) 359401
• b) 343
• c) 10101
• d) 249501

Go Maths!

## Enigma 1435 – A good sign

Like many people I read the New Scientist on a weekly basis. One of the things that annoys me is the weekly (usually) maths based puzzle Enigma.

This week’s puzzle is thus:

The distance between any pair of the villages Aville, Bestown, Chipping and Dreem is a whole number of miles. A signpost in each village gives the distances to the other villages, but each sign has a different number of correct distances. The signs are as follows:

From Aville

• Bestown 7
• Chipping 9
• Dreem 9

From Bestown

• Aville 8
• Chipping 7
• Dreem 9

From Chipping

• Aville 8
• Bestown 9
• Dreem 7

From Dreem

• Aville 7
• Bestown 8
• Chipping 9

I recently did a round walk, of less than 30 miles, visiting each village and ending back where I started.

List (in the order AB, AC, AD, BC, BD, CD) the distances between the villages.

This appears to be a straight forward Traveling Sales Person problem, where the person walking around travels along a simple Hamiltonian cycle. (There are a number of assumptions about the problem here – the wording of “I did a round walk,…, visiting each village..” is quite ambiguous, so a number of assumptions are necessary)

Starting with the 6 bidirectional pairs (ie. A>B == B>A), we can see that when written out no two values from the sign posts are the same. From the question we can deduce that while its impossible for both to be correct, both CAN be incorrect.

From the fact that the 4 signs can have 0,1,2, or 3 errors we can see that there are a total of 6 errors across the signs. 6 of the 12 distances are incorrect.

As the hamiltonian cycle must be LESS THAN (not less than or equal to) the only two ways to do this with the possible values from the 6 remaining values are with either a cycle of 7, 7, 7, 7, or 7, 7, 7, 8. Any more and the total becomes 30.

By elimination, we get the following values:

• A-B = 8
• B-C = 7
• C-D = 7
• D-A = 7

Once we’ve got these values all we need to do is figure out the remaining diagonal values that will satisfy the 0,1,2,3 errors condition. After testing we get the values of A-C=8 and B-D=9 that work with all the conditions.

From this, we have Aville with 3 errors, Bestown 0 errors, Chipping 1 error and Dreem 2 errors.

To get the final requested solution in the order AB, AC, AD, BC, BD, CD, we get the end solution –

8, 8, 7, 7, 9, 7

Or if you wish, here’s a diagramatic layout of the towns.

Oh what fun. Will this become a regular feature? Who knows? Not me. All depends if I can do next weeks really. Until then.