Sunday Times Teaser 2864 – Sequence of Squares
by Victor Bryant
Published August 13 2017 (link)
I started with a rectangle of paper. With one straight cut I divided it into a square and a rectangle. I put the square to one side and started again with the remaining rectangle. With one straight cut I divided it into a square and a rectangle. I put the square (which was smaller than the previous one) to one side and started again with the remaining rectangle. I kept repeating this process (discarding a smaller square each time) until eventually the remaining rectangle was itself a square and it had sides of length one centimetre. So overall I had divided the original piece of paper into squares. The average area of the squares was a two-figure number of square centimetres.
What were the dimensions of the original rectangle?
-
Brian Gladman permalink1234567891011121314151617from itertools import count# start from the last square and work backwards to the starting retanglea, b, area_sqrs = 1, 1, 1# the number of squares so farfor no_sqrs in count(2):# ... and their total areaarea_sqrs += b * b# add a square (of side b) to form a larger rectangle b x (a + b)a, b = b, a + b# find an average area for the squares that is a two digit integerav, rem = divmod(area_sqrs, no_sqrs)if not rem and 10 <= av < 100:print(f'{a} x {b} cm')break