The Lambert W function and quantum statistics