Factorial series connected with the Lambert function, and a problem posed by Ramanujan