## Enigma 1771

Spoiler for New Scientist Enigma 1771: “Squares either way” (Follow the link to see the puzzle.)

For the first part the smallest and largest numbers that represent dates in either format are 010100 and 121299, whose square roots are 100+ and 348+. We could just examine the squares of all the numbers from 100 to 348, but let’s make it easier.

We want squares of the form 0x0xyz or 1x1xyz. For instance, are there any squares of the form 0101yz? Well, √010100 > 100 and √010199 < 101, so no. Likewise for all the other possibilities except: √040400 > 200 and √040499 < 202, so 2012 = 0404yz, specifically 040401, as stated in the enigma; and √070700 > 265 and √ 070799 < 267, so 2662 = 070756. So answer to part 1): 7 July 2056.

For the other two parts, we’re looking for the next (chronologically) square date in a particular format where the last two digits are the year. Here we can consider numbers up to 311299, whose square root is 557+, so we could examine the squares of all numbers from 100 to 557. Or we could be smart about it.

Is the next square date this year? No, because no square ends in 3.

Next year? Squares can end in 4. But you’d need to square a number of the form xy2 or uv8. In the first case the second to last digit of the square is 4y mod 10; in the second case it’s 16v+6 mod 10. Either way it’s even, so can’t be 1 to give us a date in 2014.

2015? Here the square root must be of the form xy5, and the second to last digit of the square of xy5 is 10y+2 mod 10 = 2. Not 1.

2016? Now we have xy4 or uv6. In the first case the second to last digit of the square is 8y+1 mod 10, and in the second case it’s 12v+3 mod 10. Either way, it’s odd. For it to be 1 we need y=0 or 5, or v=4 or 9. So we have the following candidate numbers: 104, 146, 154, 196, 204, 246, 254, 296, 304, 346, 354, 396, 404, 446, 454, 496, 504, 546, 554.

The squares of these numbers that constitute legal dates in one form or the other are: 010816, 021316, 041616, 060516, 092416. It’s coincidental, I think, that the squares of all the candidate numbers from 346 on up have large values for the middle two digits (32 or larger), whereas for all but 346 and 354 we would need the middle two digits to be 12 or less. For part 2), 060516 = 6 May 2016 is the next day:month:year square date (and the only other such square date in 2016 is 1 August). For part 3), 010816 = 8 Jan 2016 is the next month:day:year square date (and the other square dates are 13 Feb, 16 Apr, 5 Jun, and 24 Sep).

## @standupmaths 24 Sep 13

Spoiler for @standupmaths puzzle 24 Sep 13 (Follow the link to see the puzzle.)

This is a quickie. Most of the numbers from 1 to 17 have only two other numbers in that range they can add to to get a square. For instance the numbers from 9 to 15 can add to the numbers from 7 to 1 (to get 16) or the numbers from 16 to 10 (to get 25) and nothing else. The only exceptions are 1 and 3, which can add to three other numbers, and 16 and 17, which can add to only one.

So right away we know the sequence has to start with 16 and end with 17 (or vice versa). The number after 16 has to be 9, and now that we’ve used 16 there’s only one number 9 can add to, which is 7. And so on until we hit 13 followed by 3, when we have two possibilities: 1 and 6. But working backward from 17 we find 17 is preceded by 8 is preceded by 1, with 6, 10 and 15 unused. So 3 must be followed by 6, then 10, then 15, then 1 and on from there to 17:

16 – 9 – 7 – 2 – 14 – 11 – 5 – 4 – 12 – 13 – 3 – 6 – 10 – 15 – 1 – 8 – 17

## Enigma 1705

Spoiler for New Scientist Enigma 1705:

Harry and Tom have each found a 4-digit perfect square, a 3-digit perfect cube and a 3-digit triangular number that use 10 different digits, but with no leading zero. A triangular number is one that fits the formula n(n+1)/2, such as 1, 3, 6, 10, 15.

Even if I told you Harry’s triangular number you would not be able to deduce with certainty which perfect square he has found. Even if I told you Tom’s perfect square you would not be able to deduce with certainty which triangular number he has found.

What are (a) Harry’s triangular number, and (b) Tom’s perfect square?

Break out the tables of squares, cubes, and triangular numbers…

There are only four 3-digit perfect cubes with no repeated digits: 125, 216, 512, and 729. Notice that each of these uses 2.

The 4-digit perfect squares with no repeated digits and no 2 are: 1089, 1369, 1764, 1849, 1936, 3481, 4096, 4356, 4761, 5041, 5184, 5476, 6084, 7056, 7396, 7569, 8649, 9604, 9801. Notice that each of these uses either 1 or 6 (or both), so the cube 216 can’t be used.

If the cube is 125 or 512, then the squares that could be used are 4096, 6084, 7396, 8649, and 9604. For 6084 and 7396 there are no 3-digit triangular numbers that use the remaining three digits. For 8649 there is 703, giving two sets of numbers (square, cube, triangular):

• 8649, 125, 703
• 8649, 512, 703

For 4096 and 9604 there is 378, giving four sets:

• 4096, 125, 378
• 4096, 512, 378
• 9604, 125, 378
• 9604, 512, 378

If the cube is 729, then the squares that could be used are 3481, 4356, 5041, 5184, and 6084. For 3481, 4356, and 5041 there are no 3-digit triangular numbers that use the remaining three digits. For 5184 there is 630, giving one set of numbers:

• 5184, 729, 630

For 6084 there are 153 and 351, giving two sets of numbers:

• 6084, 729, 153
• 6084, 729, 351

If I’ve done this right these are all the sets of such numbers that use all ten digits with no leading zero.

So Harry’s triangular number is 378 (his square could be 4096 or 9604), and Tom’s square is 6084 (his triangular number could be 153 or 351).

## Enigma 1696

Spoiler for New Scientist Enigma 1695:

A set of snooker balls contains six coloured and 15 red balls. From such a set Harry took some coloured balls and a larger number of reds and put them in his bag. From the remainder Tom took some coloured balls and some reds (more of each than Harry took) and put them into his bag.

Each of them calculated that if he drew two balls at random out of his own bag simultaneously there was a 1 in X chance that they would both be coloured, X representing the same number for each person.

How many coloured balls and how many red balls from the set were not taken by either of them?

Edited 12 May to correct an error right at the end.

Pretty easy this week. I was a little taken aback by the word “simultaneously” but presumably that just means you don’t put one ball back before drawing the second. If there are nc colored (excuse my spelling) balls and nr red balls totalling N = nc + nr then the probability that both balls drawn are colored is (nc/N)((nc–1)/(N–1)) = (nc2nc)/(N2N). We just have to find two pairs of values for nc and N consistent with the problem statement such that the probabilities are equal.

First of all, notice that Harry must have taken 2 colored balls. No fewer, partly because it says “balls”, plural, and partly because if he took fewer than 2, his probability of drawing 2 colored balls would be zero, which can’t be expressed as “a 1 in X chance”. But if he took 3 then Tom could not take more colored balls than Harry did. So Harry took 2, leaving 4, of which Tom took either 3 or all 4. (Harry also took some red balls — no more than 7, because Tom took more — making a total of NH, and Tom took some of the rest, making a total of NT.)

That means Harry’s probability of drawing 2 colored balls is 2/(NH2NH) while Tom’s is 6/(NT2NT) or 12/(NT2NT). Either way it must be that NT2NT is divisible by 3, since it’s either 3 or 6 times NH2NH. This happens if NT equals 0 or 1 modulo 3. NT is at least 4 and no more than 18. So NT2NT is 12, 30, 42, 72, 90, 132, 156, 210, 240, or 306. Of these the only one that is 3 times a number of the form NH2NH is 90, and the only one that is 6 times a number of that form is 72. This means we have either NT = 10 and NH = 6, or NT = 9 and NH = 4. In the former case ncH = 2, nrH = 4, ncT = 3, nrT = 7, and in the latter case ncH = 2, nrH = 2, ncT = 4, nrT = 5. But the second case violates the requirement that Harry took “a larger number of reds” (larger than the number of colored balls he took). So they took a total of 5 colored balls and 11 reds, leaving 1 colored and 4 red.

## Enigma 1695

Spoiler for New Scientist Enigma 1695:

In the following list of five numbers I have consistently replaced digits by letters, with different letters being used for different digits: CAST THE ODD ONE OUT. All but one of those five numbers is a perfect square. What is the numerical value of the odd one out?

At least two of THE, ONE, and OUT are squares with no repeated digits, so we need a list of those:

169, 196, 256, 289, 324, 361, 529, 576, 625, 729, 784, 841, 961

ODD may be a 3-digit square with last two digits the same: 100, 144, 400, 900

If ODD is 100 or 144 then one of ONE and OUT must be 169 or 196 while the other is not a square. If ODD is 400 then neither ONE nor OUT can be a square, so ODD isn’t 400. If ODD is 900 then one of ONE and OUT must be 961 while the other is not a square.

Therefore either ODD is not a square, or it is and one of ONE and OUT is not. Either way, CAST and THE are squares.

T is the last digit of a square (that does not end with the same digit twice) so must be 1, 4, 5, 6, or 9. Therefore THE can be only 169, 196, 529, 576, 625, or 961.

Suppose ODD is not a square. Then possible values for ONE and OUT are: 256 and 289 (in either order), 324 and 361, 529 and 576, or 729 and 784. Then the first and last digits of THE, in either order, must be 6 and 9, 1 and 4, 6 and 9, or 4 and 9, respectively. But none of the possible values of THE satisfies any of those requirements. Therefore ODD is a square, and either ONE or OUT is the non square.

If ODD is 900 then one of ONE and OUT must be 961, so T is 1 or 9; but then H is 6 or 9, both of which have been used.

If ODD is 100 or 144 and OUT is 169 then THE must be 961, re-using a digit.

If ODD is 100 or 144 and OUT is 196 then THE must be 625. CAST must end in 6 and the four unused digits are 0, 3, 7, 8 or 3, 4, 7, 8 depending on ODD. Either way there are no 4-digit squares ending in 6 with the other 3 digits different and chosen from 0, 3, 4, 7, 8.

Similarly, if ODD is 100 or 144 and ONE is 169 then THE must be 529, and there are no values for CAST.

If ODD is 100 and ONE is 196 then THE must be 576, and there are no values for CAST.

The one remaining possibility is: ODD is 144, ONE is 196. THE must be 576 and CAST must be 3025. By elimination U is 8 and CAST THE ODD ONE OUT is 3025 576 144 196 185.

The non square is 185.