Torian

The Torian is a function invented by Aalbert Torsius. It is defined as \(T(x) = x!x\), using Torsius' definition of the factorial:

\(x!n = \prod^{x}_{i = 1} i!(n - 1) = 1!(n - 1) \cdot 2!(n - 1) \cdot \ldots \cdot x!(n - 1)\), \(x!0 = x\)

This definition is a generalization of the ordinary factorial: \(x!1 = x!\).

The first few values of \(x!x\) for x = 0, 1, 2, 3, 4, 5, 6, 7 ... are 0, 1, 2, 24, 331776, 2524286414780230533120, 1.8356962141506&times;1082, 5.1012625185483&times;10315, ...

Faster method of computation
There are possible to calculate T(x) with much more faster way.

\(trn_x(n) = trn_{x-1}(1) + trn_{x-1}(2) + trn_{x-1}(3) \cdots trn_{x-1}(n)\) \(trn_0(n) = n\).

The process of computing \(trn_x(n)\) can be also shorted using formula \({n(n+1)(n+2)...(n+x-1) \over (n+1)!}\)

Here "\(trn_x\)" stands for order-x.

Then consider how it relates to x-order factorials:

\(n!2 = 2 \times (2 \times 3) \times (2 \times 3 \times 4) \ldots (2 \times 3 \times 4 \ldots (n-1) \times n)\). Multiplication is commutative, and we know that 2 appears in that expression n-1 times, 3 appears n-2 times, and x appears n-(x-1) times.

Thus, \(n!2 = 2^{n-1} \times 3^{n-2} \times 4^{n-3} \times 5^{n-4} \cdots n\) It can be also written as follows: \(n!2 = 2^{trn_0(n-1)} \times 3^{trn_0(n-2)} \times 4^{trn_0(n-3)} \times 5^{trn_0(n-4)} \cdots n\)

By the analogical considerations, \(n!3 = 2^{trn_1(n-1)} \times 3^{trn_1(n-2)} \times 4^{trn_1(n-3)} \times 5^{trn_1(n-4)} \cdots n\)

In general, \(n!x = 2^{trn_{x-2}(n-1)} \times 3^{trn_{x-2}(n-2)} \times 4^{trn_{x-2}(n-3)} \times 5^{trn_{x-2}(n-4)} \cdots n\)

Pseudocode
// Torsius' factorial extension function factorialTorsius(z, x): if x = 0: return z result := 1 for i from 1 to z: result := result * factorialTorsius(i, x - 1) return result // Torian function torian(x): return factorialTorsius(x, x)