Generalized Bernoulli numbers and a formula of Lucas