Sunday Times Teaser 3049 – Plantation
by Andrew Skidmore
Published Sunday February 28 2021 (link)
Jed farms a large, flat, square area of land. He has planted trees at the corners of the plot and all the way round the perimeter; they are an equal whole number of yards apart.
The number of trees is in fact equal to the total number of acres (1 acre is 4840 square yards). If I told you an even digit in the number of trees you should be able to work out how far apart the trees are.
How many yards are there between adjacent trees?
6 Comments
Leave one →
@Brian,
Did you consider:
Thanks for introducing the line 29/30 approach. I would have done a len(..) == 1 statement.
@Frits Yes, I was aware of that approach. But I try to avoid the need for
non-standard library imports unless they are really needed in order to
provide published code that runs ‘out of the box’ without the need for
other files. The problem with this teaser from a coding perspective
is that it can be easily analysed it to the point where its not even
worth coding!
@Erling, this version is easier to read but surely (44 % n) equals 44 for n > 44
@Frits. That was my fault with some faulty editing, corrected now.