Given the following action $$S=\frac{1}{16\pi G}\int d^4x \sqrt {-g}(R+aR^2+bR_{\mu\nu}R^{\mu\nu}+cR_{\mu\nu\lambda\sigma}R^{\mu\nu\lambda\sigma}),$$ which is in 4D.
How to we generalise this action into $d$ spacetime dimension? By which I will need the specific form of Scalar curvature, Ricci tensor, and Riemann tensor.
Also I want to know if the proportionality factor $\frac{1}{16\pi G}$ changes?
Edited to add: One way I can think of answering myself is to write the Riemann Tensor in terms of Weyl Tensor as $$R_{\mu\nu\rho\sigma}=C_{\mu\nu\rho\sigma}+\frac{1}{D-2}(g_{\mu\rho}R_{\nu\sigma}+R_{\mu\rho}g_{\nu\sigma}-g_{\nu\rho}R_{\mu\sigma}-R_{\nu\rho}g_{\mu\sigma})-\frac{1}{(D-1)(D-2)}R(g_{\mu\rho}g_{\nu\sigma}-g_{\mu\sigma}g_{\nu\rho})$$ where one can use contraction to derive $R_{\mu\nu}$ and $R$. But is there any simpler way?