In mathematics, the K-function, typically denoted K(z), is a generalization of the hyperfactorial to complex numbers, similar to the generalization of the factorial to the gamma function.
Formally, the K-function is defined as
![K(z)=(2\pi )^{(-z+1)/2}\exp \left[{\begin{pmatrix}z\\2\end{pmatrix}}+\int _{0}^{z-1}\ln(\Gamma (t+1))\,dt\right].](https://wikimedia.org/api/rest_v1/media/math/render/svg/dc6cc56f52e0df69c5f288dc0091392fc5dad978)
It can also be given in closed form as
![K(z)=\exp \left[\zeta ^{\prime }(-1,z)-\zeta ^{\prime }(-1)\right]](https://wikimedia.org/api/rest_v1/media/math/render/svg/82fbdf9734f7e2a7e05c26bd0bf87f4423791115)
where ζ'(z) denotes the derivative of the Riemann zeta function, ζ(a,z) denotes the Hurwitz zeta function and
![\zeta ^{\prime }(a,z)\ {\stackrel {\mathrm {def} }{=}}\ \left[{\frac {\partial \zeta (s,z)}{\partial s}}\right]_{s=a}.](https://wikimedia.org/api/rest_v1/media/math/render/svg/8dc645a7a6f18750e5cb36d93e353a844b70c412)
Another expression using polygamma function is[1]

Or using balanced generalization of polygamma function:[2]

- where A is Glaisher constant.
It can also be shown that for
:
This can be shown by defining the function
such that:
Deriving this identity now with respect to
yields:
Applying the logarithm rule we get
By the definition of the K-Function we write
And so
Setting
we have
Now one can deduce the identity above.
The K-function is closely related to the gamma function and the Barnes G-function; for natural numbers n, we have

More prosaically, one may write

The first values are
- 1, 4, 108, 27648, 86400000, 4031078400000, 3319766398771200000, ... ((sequence A002109 in the OEIS)).