Energy levels of two- and three-dimensional polarons in a magnetic field.