Sum of squared deviates