  The two-dimensional n-body problem of classical mechanics is a non-integrable
Hamiltonian system for n > 2. Traditional numerical integration algorithms,
which are polynomials in the time step, typically lead to systematic drifts in
the computed value of the total energy and angular momentum. Even symplectic
integration schemes exactly conserve only an approximate Hamiltonian. We
present an algorithm that conserves the true Hamiltonian and the total angular
momentum to machine precision. It is derived by applying conventional
discretizations in a new space obtained by transformation of the dependent
variables. We develop the method first for the restricted circular three-body
problem, then for the general two-dimensional three-body problem, and finally
for the planar n-body problem. Jacobi coordinates are used to reduce the
two-dimensional n-body problem to an (n-1)-body problem that incorporates the
constant linear momentum and center of mass constraints. For a four-body
choreography, we find that a larger time step can be used with our conservative
algorithm than with symplectic and conventional integrators.
