online advertising
Loading [MathJax]/jax/output/HTML-CSS/jax.js

Wednesday, October 12, 2016

Rectangles with integer dimensions

Problem:

Find all rectangles with integer dimensions such that its perimeter is equals to its area.

Solution:

Let the length and width of the rectangle be x and y respectively. We have

2(x+y)=xy

Of course, subject to the constraints that x0, y0, x,yZ.

The key idea is to factorize this as follow:

xy2x2y+4=4
(x2)(y2)=4

Once we have that, we know there are only a handful of integer factorization of 4, and we can now check:

(x2)=1,(y2)=4 gives x=3, y=6
(x2)=2,(y2)=2 gives x=4, y=4

So there we go, there are only two rectangles that satisfy the requirements.

No comments:

Post a Comment