  A new class of higher-curvature modifications of $D(\geq 4$)-dimensional
Einstein gravity has been recently identified. Densities belonging to this
"Generalized quasi-topological" class (GQTGs) are characterized by possessing
non-hairy generalizations of the Schwarzschild black hole satisfying
$g_{tt}g_{rr}=-1$ and by having second-order equations of motion when
linearized around maximally symmetric backgrounds. GQTGs for which the equation
of the metric function $f(r)\equiv -g_{tt}$ is algebraic are called
"Quasi-topological" and only exist for $D\geq 5$. In this paper we prove that
GQTG and Quasi-topological densities exist in general dimensions and at
arbitrarily high curvature orders. We present recursive formulas which allow
for the systematic construction of $n$-th order densities of both types from
lower order ones, as well as explicit expressions valid at any order. We also
obtain the equation satisfied by $f(r)$ for general $D$ and $n$. Our results
here tie up the remaining loose end in the proof presented in arXiv:1906.00987
that every gravitational effective action constructed from arbitrary
contractions of the metric and the Riemann tensor is equivalent, through a
metric redefinition, to some GQTG.
