# Multi-indexed sum

#### ZaidAlyafey

##### Well-known member
MHB Math Helper
How to write something similar to the following

Or is it better to write

$$\displaystyle \sum_{n=k ,m=1}^{k+1}$$

Last edited:

#### Jameson

Staff member
Try this syntax that produces the following output:

\large \sum_{p^{m} \le x \atop \text{p is prime }m \ge 1 }

$$\displaystyle \large \sum_{p^{m} \le x \atop \text{p is prime }m \ge 1 }$$

The spacing and sizing could use a little work but it's a good start for now.

EDIT: Just found another one on the same page. Try this code as well:

\large \sum_{\substack{p^{m} \le x \\ \text{p is prime }m \ge 1}}

$$\displaystyle \large \sum_{\substack{p^{m} \le x \\ \text{p is prime }m \ge 1}}$$

#### Evgeny.Makarov

##### Well-known member
MHB Math Scholar
There is also the subarray environment, which is similar to the regular array environment. It allows aligning the subscripts left or right.

\atop is a plain TeX command.