  The alternating and non-alternating harmonic sums and other algebraic objects
of the same equivalence class are connected by algebraic relations which are
induced by the product of these quantities and which depend on their index
calss rather than on their value. We show how to find a basis of the associated
algebra. The length of the basis $l$ is found to be $\leq 1/d$, where $d$ is
the depth of the sums considered and is given by the 2nd {\sc Witt} formula. It
can be also determined counting the {\sc Lyndon} words of the respective index
set. The relations derived can be used to simplify results of higher order
calculations in QED and QCD.
