Finding Closest Perfect Squares