### Random Post

### Recent Posts

- Tantalizer 450: Marriage problems
- Enigma 1057: Recycled change
- Enigma 452: Figure out these letters
- Puzzle 46: I lose my specs
- Enigma 1058: A row of colours
- Enigma 451: Double halved
- Tantalizer 451: Death rates
- Enigma 1059: Century break
- Enigma 450: A pentagonal problem
- Puzzle 48: Verse on the island

### Recent Comments

Jim Randell on Tantalizer 450: Marriage … | |

Brian Gladman on Enigma 1057: Recycled cha… | |

Jim Randell on Enigma 1057: Recycled cha… | |

geoffrounce on Enigma 452: Figure out these… | |

Jim Randell on Enigma 452: Figure out these… |

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (50)
- teaser (3)

### Site Stats

- 184,975 hits

Advertisements

If we consider the square to be of side

N, and the integer distancesAP,BP,CPto bea,b,crespectively. And let’s assume thata≤b.We choose integers

aandb, such thata≤N/√2, anda≤b≤N√2.Then labelling the angle ∠

ABPasθwe have (applying the cosine rule to triangleABP):which gives:

let’s say:

so:

Now in the triangle BCP:

and:

so:

also:

so:

or (remembering that

y= 2Nb):Now,

cis an integer, soc²is also an integer, so it follows that 2Nbsin(θ) must be an integer, hencey² –x² must be a perfect square, sayz², so (x,z,y) are a Pythagorean triple.So for a given

N, we can chooseaandband see if we get a validc. This Python program checks the possibilities for N from 1 to 52. It runs in 71ms.Solution:The smaller square has sides of 51. The distancesPA,PB,PCare 25, 52, 53.As the setter said it took some hours for a

ZX Spectrumto come up with the square given in the puzzle I thought I would code my program inBBC Basic(using BeebEm3) to see how long it would take to run. This code runs in 10½ minutes (equivalent time on an actualBBC B).Of course, even 10½ minutes is longer than it takes to get the answer by noticing that we can fit the triangles

ABPandBCPinto a 51 × 51 square by joining them along the sides of length 52.Analytic geometry solution without using angles.

Point in the square P(x,y), Square’s side=a

Naim: This code doesn’t seem to find the solution for a square with side 51.

Hi Jim,

Check your figure’s side which is 52.

Here is the output:

Square Side= 52

Three Distances= 25 , 51, 53

Square Side= 52

Three Distances= 53, 51, 25

The output from your program gives the square shown in the diagram in the problem statement (in two different ways).

The puzzle is to find a square with a side

less than52.You should find there is a square of side 51, and the three distances are 25, 52 and 53.

Ok, Jim. No fraction step in ” for loop” in python except list implementation and writing a function for it. The coordinates of the point P(x,y) are approximately x=6,127 and y=24.235 for side length 51.

The horizontal and vertical displacements of P from B are given by:

(N² + b² – c²) / 2N and (N² + b² – a²) / 2N.

When N=52 these are 24 and 45.

But when N=51 they are 416/17 (≈ 24.47) and 780/17 (≈ 45.88), which is why your program didn’t find them. Although the distances PA, PB, PC are integral, the horizontal and vertical displacements of P from the corners are not necessarily integers.

The coordinates I had indicated was for 52, not for 51,

Here are another properties for 52

Square Side= 52

Four İnteger Distances= 25 51 53 53 x= 7 y= 28

Square Side= 52

Four İnteger Distances= 53 51 25 25 x= 28 y= 7