convert factorials to gamma-function format