completed euler problem #8