Finding the factorial of any natural number is just finding the product of first natural numbers, moreover product of two positive numbers and is just the summation of or . Therefore the factorial of a number can also be calculated using only the addition operator.
For example:
(No addition)
(No addition)
(No addition)
OR (2 additions)
OR (How many addition here? Do you see a pattern?)
What is the minimum number of additions that you need to perform to find the factorial of when you are allowed to use only (+) operation ? ( Hint: Generalize it for the factorial of any non-negative integer )
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
0 ! = 1 (No addition)
1 ! = 1 (No addition)
2 ! = 2 (No addition)
3 ! = 3 × 2 ! = ( 2 ! ) + ( 2 ! ) + ( 2 ! ) (2 additions)
4 ! = 4 × 3 ! = ( 3 ! ) + ( 3 ! ) + ( 3 ! ) + ( 3 ! ) (2+4-1=5 additions)
5 ! = 5 × 4 ! = ( 4 ! ) + ( 4 ! ) + ( 4 ! ) + ( 4 ! ) + ( 4 ! ) (5+5-1=9 additions)
6 ! = 6 × 5 ! = ( 5 ! ) + ( 5 ! ) + ( 5 ! ) + ( 5 ! ) + ( 5 ! ) + ( 5 ! ) (9+6-1=14 additions)
7 ! = 7 × 6 ! = ( 6 ! ) + ( 6 ! ) + ( 6 ! ) + ( 6 ! ) + ( 6 ! ) + ( 6 ! ) + ( 6 ! ) (14+7-1=20 additions)
8 ! = 8 × 7 ! = ( 7 ! ) + ( 7 ! ) + ( 7 ! ) + ( 7 ! ) + ( 7 ! ) + ( 7 ! ) + ( 7 ! ) + ( 7 ! ) (20+8-1=27 additions)
9 ! = 9 × 8 ! = ( 8 ! ) + ( 8 ! ) + ( 8 ! ) + ( 8 ! ) + ( 8 ! ) + ( 8 ! ) + ( 8 ! ) + ( 8 ! ) + ( 8 ! ) (27+9-1=35 additions)
1 0 ! = ( 9 ! ) + ( 9 ! ) + ( 9 ! ) + ( 9 ! ) + ( 9 ! ) + ( 9 ! ) + ( 9 ! ) + ( 9 ! ) + ( 9 ! ) + ( 9 ! ) (35+10-1=44 additions)
Generally, if there are N number of additions performed to find ( n − 1 ) ! then n ! can be found by performing N + n − 1 number of additions such that the base cases are 0 ! , 1 ! and 2 ! that require no addition.
You can recursively find out the number of additions performed using the function: