Search for a tool
Factorial

Tool for computing factorials. Factorial n! is the product of all integer numbers (not zero) inferior or equal to n, it is symbolized by an exclamation point juxtaposed after the number.

Results

Factorial -

Tag(s) : Arithmetics

Share
Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!


Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!


Feedback and suggestions are welcome so that dCode offers the best 'Factorial' tool for free! Thank you!

Factorial

Factorial Calculator N!


Gamma Calculator Γ(N)




Answers to Questions (FAQ)

What is a factorial? (Definition)

Factorial of a number $ n $ is the product of the positive integers numbers (not null) less or equal to $ n $.

The usual notation to indicate a factorial is the exclamation mark positioned after the number. The factorial of $ n $ is noted $ n! $.

How to calculate a factorial?

Factorial is calculated with a multiplication

$$ n!=\prod_{k=1}^n k = 1 \times 2 \times 3 \times \cdots \times n $$

Example: $$ 4! = 1 \times 2 \times 3 \times 4 = 24 $$

Example: The number of ways to sort a set of 52 cards is worth $ 52! = 1 \times 2 \times \dots \times 51 \times 52 = \\ 806581751709438785716606368564037\\66975289505440883277824000000000000 \\ \approx 8.0658 \times 10^{67} $$

Note that the factorial of zero is equal to one: $ 0! = 1 $

Example: Here are the values of the first factorials $$ 0! = 1 \\ 1! = 1 \\ 2! = 2 \\ 3! = 6 \\ 4! = 24 \\ 5! = 120 \\ 6! = 720 \\ 7! = 5040 \\ 8! = 40320 \\ 9! = 362880 \\ 10! = 3628800 $$

What is the Gamma Function?

Euler-Gamma is an extension of the factorial function over the complex numbers set.

$$ \Gamma(n+1) = \int_0^{+\infty} t^n \exp(-t) \rm{d}t $$

and the formula that links gamma to the factorial:

$$ \forall\,n \in \mathbb{N}, \; \Gamma(n+1)=n! $$

How to calculate a negative factorial?

For computing the factorial equivalent of negative numbers, use the Gamma function.

How to calculate a factorial for a decimal number?

Pour computing the factorial equivalent of fraction or decimal numbers, use the Gamma function.

What is the algorithm of the factorial function?

The factorial algorithm with a loop:function fact(n) {
f = 1
if (n >= 2) {
for (i = 2 ; i < n; i++) {
f = f * i
}
}
return f
}

The recursive factorial algorithm: function fact(n) {
if (n <= 1)
return 1
else
return fact(n-1)*n
}

How to quickly compute a factorial value?

For large numbers, it is possible to estimate the value of $ n! $ with a good precision using the Stirling formula. $$ n!\sim\sqrt{2\pi n}\left(\frac{n}{e}\right)^n $$

How to calculate the product of consecutive integers?

To calculate the product of numbers between $ n $ and $ n + m $, use factorials:

$$ \prod_{i=0}^m (n+i) = n(n+1)(n+2)\cdots(n+m) = \frac{(n+m)!}{(n-1)!} $$

Source code

dCode retains ownership of the "Factorial" source code. Except explicit open source licence (indicated Creative Commons / free), the "Factorial" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or the "Factorial" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Factorial" are not public, same for offline use on PC, mobile, tablet, iPhone or Android app!
Reminder : dCode is free to use.

Cite dCode

The copy-paste of the page "Factorial" or any of its results, is allowed (even for commercial purposes) as long as you credit dCode!
Exporting results as a .csv or .txt file is free by clicking on the export icon
Cite as source (bibliography):
Factorial on dCode.fr [online website], retrieved on 2024-07-18, https://www.dcode.fr/factorial

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Feedback and suggestions are welcome so that dCode offers the best 'Factorial' tool for free! Thank you!


https://www.dcode.fr/factorial
© 2024 dCode — El 'kit de herramientas' definitivo para resolver todos los juegos/acertijos/geocaching/CTF.
 
Feedback