How are you supposed to remove the (1) next to the LaTeX equation? [duplicate]

I'm new to LaTeX. I was writing this equation the other day.

$$\sum_{1}^{n} = \left\{\begin{array}{lr} 1, & n=1\\ n+\sum_{1}^{n-1}, &\forall n>1 \end{array}\right.$$



But when I executed it, there was always this (1) dangling on the side.

Can anyone help get rid of it?

• JamesT has answered your question, but the idea of the (1) is that elsewhere in your paper you can say "as we saw/see in Equation (1)". You can even use LaTeX's label/ref mechanism to have the (1) automatically change if you rearrange your equations. Commented May 31, 2023 at 12:45

You need to use the starred environments to remove the automatic equation numbering i.e. \begin{equation*} and \end{equation*}:

\documentclass{article}

\usepackage{mathtools}

\begin{document}
\begin{equation*}
\sum_{1}^{n} =
\left\{\begin{array}{lr}
1, & n=1\\
n+\sum_{1}^{n-1}, &\forall n>1
\end{array}\right.
\end{equation*}
\end{document}


A more succinct way that reduces typing is to follow the advice from @barbara beeton and use $ and $ to wrap the one-line equation in:

\documentclass{article}

\usepackage{mathtools}

\begin{document}
$\sum_{1}^{n} = \left\{\begin{array}{lr} 1, & n=1\\ n+\sum_{1}^{n-1}, &\forall n>1 \end{array}\right.$
\end{document}


which produces the same output image.

• Thank you very much!
– Sean
Commented May 31, 2023 at 0:40
• @Sean - The "starred" varieties of LaTeX commands and environments often [but not universally] serve to eliminate numbering. This is the case not only for equation/equation* display-math environments, but also for other, multi-line math environments -- align vs. align*, gather vs. gather*, etc -- and for commands such as \chapter, \section, and \subsection. To create unnumbered chapter, section, and subsection level headers, just write \chapter*, \section*, and \subsection*.
– Mico
Commented May 31, 2023 at 5:23
• An alternative to equation* is to wrap the (one-line) display in $...$. Commented May 31, 2023 at 12:46

Using cases enviroment.

\documentclass[12pt]{article}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{equation*}
\sum_{1}^{n} = \begin{cases}
1, & n=1\\
n+\sum_{1}^{n-1}, &\forall n>1
\end{cases}
\end{equation*}
\end{document}


• In order to answer the question itself, you would need to use the starred equation environment ;) Commented May 31, 2023 at 10:52
• @KersouMan Thank you very much for your advice. Commented Jun 1, 2023 at 7:26