Homogeneous electron gas in arbitrary dimensions