"Hyperfactorial" (= 1^1 2^2 ... n^n) has a particularly simple "Stirling's formula": In[54]:= Hyperfactorial@z | E^(1/12 - z^2/4 - Zeta'[-1]) z^(1/12 + z/2 + z^2/2) (Zeta'[-1] and Zeta'[2] are connected In[78]:= Zeta'[-1] // deGlaisher // Simplify // Distribute Out[78]= 1/12 (1 - EulerGamma - Log[2 π)) + Zeta'[2]/(2 π^2) via the zeta reflection formula.) In[55]:= Table[% // Activate, {z, .0, 9}] Out[55]= {1. | 0., 1. | 0.998755252375579, 4. | 3.99865591643225, 108. | 107.983585892636, 27647.9999999998 | 27645.6209013424, 8.63999999999998*10^7 | 8.63952270335811*10^7, 4.03107840000001*10^12 | 4.03092349178858*10^12, 3.31976639877119*10^18 | 3.31967257400642*10^18, 5.56964379417277*10^25 | 5.56952319419551*10^25, 2.1577941222941*10^34 | 2.15775718825365*10^34} Unfortunately, an exact expression of the "figure of merit" infinite product of relative errors (~ 1.0021286) requires the "next" higher factorial after "Hyperfactorial", 1^1^2 2^2^2 3^3^2 ... n^n^2, for which we still lack a consensual name. I've called it "Second Factorial", with Hyperfactorial being "First Factorial" and Factorial being "Zeroth Factorial", based on the dubious contention that the dot under the *' *in "*!*" is actually a tiny zero. Replacing that zero with 1, 2, ..., is typographically unattractive, but perhaps encircling those little numerals would help. —rwg On Sun, May 12, 2019 at 10:10 AM Bill Gosper <billgosper@gmail.com> wrote:
n!/√(2πn)e^n/n^n ~ 1 + O(1/n), whose infinite product over n blows up, giving an infinite figure of demerit. For convergence, we can improve Stirling's approximation: n! ~ √(2π(n+1/6)) n^n/e^n ~ n! (1+1/(144 n^2)+. . .). Then the infinite product of all the relative errors is In[86]:= Product[n!/√(2 π (n + 1/6)) n^n/E^n), {n, ∞}]
Out[87]= E^( 2 Zeta'[-1] - 1/12) √(⅙! √(2π)))
Out[88]= 1.00781097654253
(BtW, Stirling's contribution was "only" the √(2π); de Moivre had already found the rest. This must have been nearly as stunning as Euler's 𝜁(2) = π²/6.)
Stirling's approximation can be improved no end. Perhaps the next better is
E^-z √(2 π z) (1/(12 z) + z)^z ~ z! (1-1/(1440 z^3)+O[1/z]^4) whose "figure of merit" is Product[z!/(E^-z √(2 π z) (1/(12 z) + z)^z),{z,∞}] == E^(2 Zeta'[-1]) √√(2π)/(BarnesG[1 - I/(2√3)] BarnesG[1 + I/(2√3)]) ~ 1.001178221812, which seems to cry out for the BarnesG reflection formula. Which, unfortunately, only applies to G(z)/G(-z), not G(z)G(-z): E.g. BarnesG[1 - I/(2 √3)]/BarnesG[1 + I/(2 √3)] == (-1)^(1/24) E^(-((I PolyLog[2, E^(-(π/√3))])/(2 π))) (π Csch[π/(2 √3)])^(-(I/(2 √3))) —rwg