RosettaCodeData/Task/Left-factorials/00-TASK.txt

44 lines
1.8 KiB
Plaintext

'''Left factorials''', &nbsp; <big><big>!n</big></big>, &nbsp; may refer to either &nbsp; ''subfactorials'' &nbsp; or to &nbsp; ''factorial sums'';
<br>the same notation can be confusingly seen being used for the two different definitions.
Sometimes, &nbsp; ''subfactorials'' &nbsp; (also known as ''derangements'') &nbsp; may use any of the notations:
:::::::* &nbsp; <big><big> <b> <span style="font-family:serif">!''n''`</span> </b> </big></big>
:::::::* &nbsp; <big><big> <b> <span style="font-family:serif">!''n''</span> </b> </big></big>
:::::::* &nbsp; <big><big> <b> <span style="font-family:serif">''n''¡</span> </b> </big></big>
(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 &nbsp; (''factorial sums'') &nbsp; for &nbsp; '''left factorial''':
<big><big>
::::: &nbsp; <math> !n = \sum_{k=0}^{n-1} k! </math>
</big></big>
:::: where
<big><big>
::::: &nbsp; <math>!0 = 0</math>
</big></big>
;Task
Display the left factorials for:
* &nbsp; zero through ten &nbsp; &nbsp; (inclusive)
* &nbsp; 20 &nbsp; through &nbsp; 110 &nbsp; (inclusive) &nbsp; by tens
<br>
Display the length (in decimal digits) of the left factorials for:
* &nbsp; 1,000 &nbsp; through &nbsp; 10,000 &nbsp; (inclusive), by thousands.
;Also see:
* &nbsp; The OEIS entry: [http://oeis.org/A003422 A003422 left factorials]
* &nbsp; The MathWorld entry: [http://mathworld.wolfram.com/LeftFactorial.html left factorial]
* &nbsp; The MathWorld entry: [http://mathworld.wolfram.com/FactorialSums.html factorial sums]
* &nbsp; The MathWorld entry: [http://mathworld.wolfram.com/Subfactorial.html subfactorial]
;Related task:
* &nbsp; [http://rosettacode.org/wiki/Permutations/Derangements permutations/derangements (subfactorials)]
<br><br>