FactorialNumbers
The factorials — — the number of permutations of items.
Wikipedia
FactorialMathWorldFactorialWikidataQ120976Encyclopedia of MathematicsFactorialnLabfactorialBritannicatopic/factorialOEISA000142mathlib4Nat.factorialMATLABfactorialFactorialNumbers for .Details
- A lazy indexed collection: , and -- exact for every , since every term is computed over arbitrary-precision integers rather than floats -- , already past .
- OEIS A000142, whose offset differs from ours: A000142 opens (the duplicate ); this collection starts at , so without repeating.
- Membership goes through Element by growing the factorial sequence forward until it reaches or passes the candidate -- is true, is false. See Factorial for the scalar function.
Definition
Epsil, as the implementation runs it.
count()
PositiveInfinityunrank(_r)
Fold(Function([wk_w[1] * (wk_n + 2)], wk_w, wk_n), [1], Range(0, _r - 1, 1))[1]rank(_x)
Fold(
Function(
wk_w if wk_n >= 0 && wk_w[1] > _x else [
wk_w[1] * (wk_n + 2),
wk_n if wk_w[2] < 0 &&
wk_w[1] == _x else wk_w[2],
],
wk_w,
wk_n,
),
[1, -1],
Range(
0,
1 * (Apply(
(fl_r: list<integer>) => fl_r[2],
Fold(Function(
[
(fl_s[1] - fl_s[1] % 2 ^ fl_k) / 2 ^
fl_k,
fl_s[2] + fl_k,
] if fl_s[1] >= 2 ^ fl_k else fl_s,
fl_s,
fl_k,
), [_x + 2, 0], [
8_192,
4_096,
2_048,
1_024,
512,
256,
128,
64,
32,
16,
8,
4,
2,
1,
]),
) + 1) + 12,
1,
),
)[2] if _x >= 0 else -1valid(_x)
Fold(
Function(
wk_w if wk_n >= 0 && wk_w[1] > _x else [
wk_w[1] * (wk_n + 2),
wk_n if wk_w[2] < 0 &&
wk_w[1] == _x else wk_w[2],
],
wk_w,
wk_n,
),
[1, -1],
Range(
0,
1 * (Apply(
(fl_r: list<integer>) => fl_r[2],
Fold(Function(
[
(fl_s[1] - fl_s[1] % 2 ^ fl_k) / 2 ^
fl_k,
fl_s[2] + fl_k,
] if fl_s[1] >= 2 ^ fl_k else fl_s,
fl_s,
fl_k,
), [_x + 2, 0], [
8_192,
4_096,
2_048,
1_024,
512,
256,
128,
64,
32,
16,
8,
4,
2,
1,
]),
) + 1) + 12,
1,
),
)[2] >= 0 if _x >= 0 else FalseEnumeration
Examples
1 more kept as data, checked against the oraclesAbout
| Examples | 1 |
|---|---|
| Crosswalk | WikipediaMathWorldWikidataEncyclopedia of MathematicsnLabBritannicaOEISmathlib4MATLAB |
See also: Factorial, DoubleFactorialNumbers, SymmetricGroup, Count, At, Element