## Teaser 2862: Algebria’s standard

**From The Sunday Times, 30th July 2017** [link]

The Algebrian rectangular flag is highly symbolic. Each of its sides is an even number of inches long and a diagonal divides it into two triangles, one blue and one green, representing its two founding tribes. The length of the diagonal (in inches) is the number of states in Algebria, and the area of the flag (in square inches) is the twentieth century year in which the country obtained independence.

How many states are there in Algebria, and in which year did the country obtain independence?

[teaser2862]

## Jim Randell 12:30 pm

on9 April 2020 Permalink |If the dimensions of the flag are

XandY(and the diagonal isZ), then the areaXYis between 1901 and 2000.XandYare even (sayX = 2x, Y = 2y), which limitsxyto be between 476 and 500.Originally I looked at the possible areas to find viable

x, y, zvalues, but the following Python program uses the [[`pythagorean_triples()`

]] generator from theenigma.pylibrary to findx, y, zvalues that can be scaled up to give an appropriate flag. It runs in 76ms.Run:[ @repl.it ]Solution:There are 68 states in Algebria. It gained independence in 1920.LikeLike