Faster algorithm for LargestProductInSeries