A more general case function for combining numbers in series

- solved one problem