Teaser 3029: Square jigsaws
From The Sunday Times, 11th October 2020 [link] [link]
I chose a whole number and asked my grandson to cut out all possible rectangles with sides a whole number of centimetres whose area, in square centimetres, did not exceed my number. (So, for example, had my number been 6 he would have cut out rectangles of sizes 1×1, 1×2, 1×3, 1×4, 1×5, 1×6, 2×2 and 2×3). The total area of all the pieces was a three-figure number of square centimetres.
He then used all the pieces to make, in jigsaw fashion, a set of squares. There were more than two squares and at least two pieces in each square.
What number did I originally choose?
[teaser3029]
Jim Randell 5:17 pm on 9 October 2020 Permalink |
(See also: Enigma 1251, Enigma 1491).
If the squares are composed of at least two pieces, they must be at least 3×3.
This Python program works out the only possible original number that can work, but it doesn’t demonstrate the the rectangles can be assembled into the required squares.
It runs in 44ms.
Run: [ @repl.it ]
Solution: The original number was 29.
The rectangles cut out are:
With a total area of 882 cm².
The 1×29 piece must fit into a square of size 29×29 or larger, but this is the largest square we can make, so there must be a 29×29 square, which leaves an area of 41 cm². This can be split into squares as follows:
It turns out that it only possible to construct a packing using the second of these.
I used the polyominoes.py library that I wrote for Teaser 2996 to assemble the rectangles into a viable arrangement of squares. It runs in 19 minutes. (The adapted program is here).
Here is a diagram showing one way to pack the rectangles into a 4×4, 5×5 and a 29×29 square:
LikeLike
Frits 2:27 pm on 10 October 2020 Permalink |
@Jim,
Wouldn’t it be easier to use the chosen number n as maximum dimension (line 23)?
LikeLike
Jim Randell 11:51 am on 11 October 2020 Permalink |
@Frits: Probably. When I started writing the program I was thinking about a constructive solution, that would produce a packing of the rectangles into the required squares. This is a cut-down version of the program which finds possible sets of squares to investigate – fortunately the solutions found all correspond to the same original number, so if there is an answer we know what it must be.
And it turns out that we don’t need to examine the set of rectangles to determine the maximum dimension, so we could just pass it in. In fact we don’t need to collect the rectangles at all. Here’s a better version of the cut-down program:
I did complete a program that finds a viable packing, but it takes a while to run (19 minutes).
I’ll post the diagram with the answer later.
LikeLike
Frits 5:59 pm on 11 October 2020 Permalink |
@Jim, a nice solution with the divisor pairs.
I think we can only form one 3×3 square at most (out of 3 possibilities).
LikeLike
Frits 1:29 pm on 10 October 2020 Permalink |
I did a manual check to see if the reported squares can be formed in 2-D with the rectangular pieces.
LikeLike