Perfect Square Math Problem