I am trying to align an equation within the cases environment like so:
\begin{equation}
R_i=
\begin{cases}
2G_{\frac{i}{2} - 1} &= \frac{i^2 - 2i}{4}, & \text{if}\ 2 | i \\
2G_{\frac{i - 1}{2} - 1} + \frac{i-1}{2} &= \frac{i^2 - 2i + 1}{4}, & \text{otherwise}.
\end{cases}
\end{equation}
Unfortunately this errors with
Extra alignment tab has been changed to \cr. [...\frac{i}{2} - 1} & = \frac{i^2 - 2i}{4}, &]
How would I go about having two alignment tabs in this case?
it works without the extra &
\begin{equation}
R_i=
\begin{cases}
2G_{\frac{i}{2} - 1} = \frac{i^2 - 2i}{4}, & \text{if}\ 2 | i \\
2G_{\frac{i - 1}{2} - 1} + \frac{i-1}{2} = \frac{i^2 - 2i + 1}{4}, & \text{otherwise}.
\end{cases}
\end{equation}