The gamma function is described by the integral
and for integer arguments is related to the factorial function
It is possible to numerically implement this function in Mathematica as
gammafn[n_] := NIntegrate[x^(n-1) Exp[-x], {x,0, Infinity}]
but the gamma function is already present as part of the standard built-in set.
gammafn[1] 1. gammafn[2] 1. Gamma[2] 1 gammafn[0.5] 1.77245 Gamma[0.5] 1.77245
The integer form of the Gamma function, the factorial function, appears in the classical density of states for a set of s harmonic oscillators
and allows the corresponding partition function to be determined