Sum of squares computational formula