Problem 6 (sum-square difference)