Left factorials
This page is a solution to the task Left factorials in the Rosetta Code, written in Fōrmulæ.
Description (from Rosetta Code)
Left factorials, !n, may refer to either subfactorials or to factorial sums;
The same notation can be confusingly seen used for the two different definitions. Sometimes, subfactorials (also known as derangements) may use any of the notations:
(It may not be visually obvious, but the last example uses an upside-down exclamation mark.) This Rosetta Code task will be using this formula for left factorial:
where
Task Display the left factorials for:
Display the length (in decimal digits) of the left factorials for:
Also see
Related task |
Solution
The definition can perfectly work:
However, the following is much faster:
Case 1
Showing left factorials from zero to ten:
Case 2
Showing left factorials from 20 to 110, by tens:
Case 3
Showing length of left factorials, from 1,000 to 10,000 by thousands: