The homogeneous electron gas is one of the most studied model systems in condensed-matter physics. It is also the basis of the large majority of approximations to the functionals of density-functional theory. As such, its exchange-correlation energy has been studied extensively, and it is well-known for systems of one, two, and three dimensions. Here, we extend this model and compute the exchange and correlation energy, as a function of the Wigner-Seitz radius r(s), for arbitrary dimension D. We find a very different behavior for reduced dimensional spaces (D = 1 and 2), our three-dimensional space, and for higher dimensions. In fact, for D > 3, the leading term of the correlation energy does not depend on the logarithm of r(s) (as for D = 3), but instead scales like a polynomial: -c(D)/r(s)(gamma D), with the exponent gamma(D) = (D - 3)/(D - 1). In the large-D limit, the value of c(D) is found to depend linearly on the dimension. In this limit, we also find that the concepts of exchange and correlation merge, sharing a common 1/r(s) dependence.