An extension of the Hille-Hardy formula