\sum_{i=0}^na_ir_i