### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,367)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (48)
- site news (58)
- tantalizer (94)
- teaser (7)

### Site Stats

- 233,129 hits

Programming Enigma Puzzles

24 May 2019

Posted by on **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]

%d bloggers like this:

(See also:

Enigma 1491,Enigma 17,Enigma 1251,Enigma 1241).We can use the technique of examining horizontal and vertical slices of the diagram that I used in

Enigma 1241, except that this time the variables consist of the dimensions of the 21 smaller squares and the larger square that they fit in to (so 22 variables in all).The linear equations give us a system of 22 equations, but the system is not complete (as we can scale up all the squares by the same amount and get further solutions). But if we fix the value of the smallest square, say at 1, then we can solve the system of equations to get the size of all the other squares in relation to the smallest square.

I’ve recently enhanced the Gaussian Elimination solver (originally written for

Enigma 287) and made it available in theenigma.pylibrary as [[`matrix.linear()`

]].This Python program uses the [[

`matrix.linear()`

]] solver to solve the system of equations, verifies the (non-linear) area constraint, and then scales the solutions up so that they are all integers. It runs in 121ms.Run:[ @repl.it ]Solution:The outer square is 112 × 112 units.The dimensions of the smaller squares are: 2, 4, 6, 7, 8, 9, 11, 15, 16, 17, 18, 19, 24, 25, 27, 29, 33, 35, 37, 42, 50.

So there are 7 squares with prime dimensions: 2, 7, 11, 17, 19, 29, 37.

If the diagram was scaled up there would be no squares with prime dimensions.

It’s possibly of interest that this smallest set of 21 squares was discovered in 1962 by Adrianus Duijvestijn: see https://en.wikipedia.org/wiki/Squaring_the_square

I don’t know what computer he used, but it probably occupied about an acre of floor space and consumed enough electricity to cook dinners for a whole school.

It was previously thought that 24 squares was the fewest possible.