[Tex/LaTex] Center align formula, right align text

horizontal alignmentnumbering

I am trying to write a formula and then number it (5). The formula is meant to be center aligned and the numbering should be right aligned on the same line. This was my best attempt at doing that but when the flushright environment begins it starts a new line so the text and formula do not appear on the same line. Is there a clever way of doing this?

\begin{center} $1-\alpha$
\begin{flushright}(5)
\end{flushright}
\end{center}

Best Answer

As Werner and Gonzalo Medina say, just use

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\noindent Horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse.
\begin{equation}
1-\alpha \tag{5}
\end{equation}
Horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse, horse.

\end{document}

output