outrun, i think T4A & katastrofa both have valid points: i did assume it is simply a square, but the problem would work if it is a rectangle as well - the green circle is just the inscribed circle of the triangle. the same method applies, since the area and the circumference of the triangle are easy to calculate.your new problem seems to be related to the lower bound of integer complexity (is that the "C"?) and i believe the numbers listed here (1,2,3,7,15,63) are the only solutions (checked up to n=10,000. MCarreira would do a much better job:P). unfortunately the apparent bound 3*log3(n) does not seem to do the trick... will update
Last edited by wileysw
on May 14th, 2011, 10:00 pm, edited 1 time in total.