We present two versions of a program and the underlying algorithm, for
the efficient calculation of integrals of the form Z(r1, r2) = integr
al d3r3 p(r3) X(r1, r3) Y(r2, r3). The two versions differ in the amou
nt of required memory. Such integrals appear in many calculations in p
hysics and chemistry, specially when studying many-body problems of fi
nite systems.