A Generalization of Lerch’s Formula