Generalizations of the Markoff–Hurwitz equations over residue class rings