Definition
The centre of mass of a system of particles is that point at which the entire mass of the system may be imagined to be concentrated. For a system of $n$ particles:
$$\vec{R}_{cm} = \frac{\sum_{i=1}^{n} m_i \vec{r}_i}{\sum_{i=1}^{n} m_i} = \frac{\sum m_i \vec{r}_i}{M}$$
In one dimension,
$$x_{cm} = \frac{\sum m_i x_i}{M}, \quad y_{cm} = \frac{\sum m_i y_i}{M}$$
For continuous bodies, the sum is replaced by an integral: $\vec{R}_{cm} = \frac{1}{M} \int \vec{r} \, dm$.
Important: the centre of mass need not lie inside the material of the body; for a ring it lies at the centre, which is empty space.