Generalized numeric operations

Algorithm for common numeric operations on sequences.