In setting up a translationally invariant Hamiltonian
the following expressions are helpful.
The center-of-mass (CoM) momentum is
$$
P=\sum_{i=1}^A\boldsymbol{p}_i,
$$
and we have that
$$
\sum_{i=1}^A\boldsymbol{p}_i^2 =
\frac{1}{A}\left[\boldsymbol{P}^2+\sum_{i < j}(\boldsymbol{p}_i-\boldsymbol{p}_j)^2\right]
$$
meaning that
$$
\left[\sum_{i=1}^A\frac{\boldsymbol{p}_i^2}{2m} -\frac{\boldsymbol{P}^2}{2mA}\right]
=\frac{1}{2mA}\sum_{i < j}(\boldsymbol{p}_i-\boldsymbol{p}_j)^2.
$$