  We consider finite sequences $s\in D^n$ where $D$ is a commutative, unital,
integral domain. We prove three sets of identities (possibly with repetitions),
each involving $2n$ polynomials associated to $s$. The right-hand side of these
identities is a recursively-defined (non-zero) 'product-of-discrepancies'.
There are implied iterative algorithms (of quadratic complexity) for the
left-hand side coefficients; when the ground domain is factorial, the
identities are in effect B\'ezout identities.
  We give a number of applications: an algorithm to compute B\'ezout
coefficients over a field; the outputs of the Berlekamp-Massey algorithm;
sequences with perfect linear complexity profile; annihilating polynomials
which do not vanish at zero and have minimal degree: we simplify and extend an
algorithm of Salagean to sequences over $D$. In the Appendix, we give a new
proof of a theorem of Imamura and Yoshida on the linear complexity of reverse
sequences, initially proved using Hankel matrices over a field and now valid
for sequences over a factorial domain.
