Solution to series exercise