Returns the sum of a power series based on the formula