1

My goal is to get the most square-like rectagle. For instance, there are several cases as below where the area of rectagle is 24. And the most square-like case is the 4 by 6 (or 6 by 4). Given area, is there a simple formula to get it?(not algorithem)

    width   height
    ------  ------
    1      24
    2      12
    3       8
    4       6    <- this 
    6       4    <- or this
    8       3 
    12      2
    24      1
Soon
  • 111
  • Do you need integer side lengths? If you don't there's the easy solution of $\sqrt{24}$ by $\sqrt{24}$. – Duncan Ramage Nov 20 '20 at 03:18
  • What is your definition of "most square-like"? You can just minimise the perimeter (or equivalently, the sums of width and height). – Deepak Nov 20 '20 at 03:19
  • 1
    If you don't allow algorithms, do you allow formulas like gcd()? –  Nov 20 '20 at 03:21
  • Assuming integer side lengths, you could say the "most square rectangle" of area $A$ would be the rectangle of side lengths $d, A/d$ such that $d$ is a divisor of $A$ and for all divisors $c$ of $A$, we have $\left| \sqrt{A} - d\right| \le \left| \sqrt{A} - c \right|$ – WaveX Nov 20 '20 at 03:30

0 Answers0