correct calculation of upper bound for series