A FORMULA FOR SEMIGROUPS, WITH AN APPLICATION TO BRANCHING DIFFUSION PROCESSES