All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Shapes
Row of towers (Posted on 2024-02-23) Difficulty: 3 of 5
An assemblage of unit squares is in the form of n towers with heights 1,2,...,n forming a polyomino.

Here are two possible examples for n=4:

Find a formula for the largest possible perimeter of such a polyomino.

No Solution Yet Submitted by Jer    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Greedy Algorithm Comment 5 of 5 |
This is actually pretty easy to solve with an application of the Greedy Algorithm.  We want the heights to swing as much as possible.  So take the first tower as the largest, then the second tower as the smallest, and keep alternating between the largest available and the smallest available.
Then for example the n=10 case will have a tower sequence of 10,1,9,2,8,3,7,4,6,5.  And similarly, n=11 looks like 11,1,10,2,9,3,8,4,7,5,6.

The perimeter of such a polyomino will have 2n from the horizontal parts.  
To evaluate the vertical parts, I will start from the left; they have a descending pattern for the first n struts going n up, n-1 down, n-2 up, ...etc to the nth vertical of 1.  These have a sum of n*(n+1)/2
The final vertical will drop down from the last tower to the base, and by the construction that height will be floor[(n+1)/2].

Adding up these terms gives a perimeter of n*(n+5)/2 + floor[(n+1)/2].  The first few terms are 4,8,14,20,28,36,...  This is enough for the OEIS to bring up A265284 


  Posted by Brian Smith on 2024-02-24 11:13:57
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information