← RoseCode

ROSECODE 151

A best approximation

sinan · Math ·

For a,b,c being positive coprime integers and a < b < c, consider the following 2 integer sided squares:
S1: A(0,0); B(c,0); C(c,c); D(0,c)
S2: A'(a,0); B'(a+b,a); C'(b,a+b); D'(0,b)

What is the best approximation for Area(S1)/Area(S2)=2 if Area(S2)<10^24?
In other words find the (a,b,c) triples that minimize |Area(S1)/Area(S2)-2|

Input format: enter the list of "a" values separated by commas (possibly more than one).

Example: a1,a2,...,an (a1 < a2 < ... < an)