ARMA models are an extention of AR and MA by combination. ARMA is described as follows
$$ X_t - \phi_1 X_{t-1} - ... - \phi_p X_{t-p} = \beta + a_t - \theta_1 a_{t-1} - ... - \theta_q a_{t-a} $$where
$\beta = \left( 1 - \phi_1 - \ldots - \phi_p \right) \mu$ and $a_t$ is white noise
and is constained with
The operator for is
$$ \left( 1 - \phi_1 B - ... - \phi_p B^p \right) X_t = \left( 1 - \theta_1 B - ... - \theta_q B^q \right) $$And can generally be expressed as
$$ \phi \left( B \right) X_t = \theta \left( B \right) $$An ARMA model is valid if and only if model is stationary and invertable i.e.
Since ARMA is a combination of two models (AR and MA), the separate indexes are used to indicate the order of each model. Typically, $p$ refers to the AR order and $q$ refers to the MA order i.e. ARMA(p,q). Additionally, the order of the models are indexed with $i$ and $j$ in formulas, respectively.