# Factorial Function by Piyush Goel

we will see how Piyush Goel discovered something while playing with numbers. Here is the story . One day while sitting idle, and having nothing important to do he was just scribbling on paper. he was writing random numbers and thinking how could link them. To his amazement he discovered this: he wrote down 0, 1, 2, 3, 4, 5. Next to each number he wrote their respective squares, viz. 0,1, 4, 9, 16, 25. Then start subtracting each successive square from the next bigger square. It looks something like this: (1-0), (4-1), (9-4), (16-9) and (25-16). What is the result? he got 1, 3, 5, 7, 9. Now again subtract each successive number from the next one in the order. We are performing this: (3-1), (5-3), (7-5) and (9-7). Surprisingly, he got (2, 2, 2, 2). A 2 in each case. he was amazed and decided to take a step further. This time with cubes. So here go my numbers 0, 1, 2, 3 ,4, 5, 6. And their respective cubes: 0, 1, 8, 27, 64, 125, 216. Time to perform first round of successive subtraction, i.e. (1-0), (8-1), (27-8), (64-27), (125-64) and (216-125). The result: 1, 7, 19, 37, 61, 91. Second round of successive subtraction as performed earlier: (7-1), (19-7), (37-19), (61-37) and (91-61). And this is what he got: 6, 12, 18, 24, 30. Successive subtraction performed the third time: (12-6), (18-12), (24-18) and (30-24). And this time he got the result (6, 6, 6, 6). You see, squaring means ‘to the power 2’ and he got the result 2 after 2 successive subtractions, which is the value of 2! Cubing means ‘to the power 3’ and after performing 3 successive subtraction he got 6 in each case which is nothing but the value of 3! He similarly performed with 4th and 5th powers of the first few whole numbers. He was surprised to find the final value of 24 and 120 which are of course the values of 4! and 5!. It was all right up to 5, but he wanted to go a notch higher and check for 6 just for my personal satisfaction. While doing for 6th power the calculations were massive and numbers so huge that it took him a couple of hours to do his calculations. Just to be sure he also did it for numbers upto 15. Put 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 and 15 and their respective 6th powers: 0,1,64,729, 4096, 15625, 46356, 11649, 262144, 531441, 1000000, 1771561, 2985984,4826809, 7829536 and 11390625. He kept on doing successive subtractions till to his contentment he finally got 720 for all which is the value of 6!

Note by Gita Goel
4 years, 4 months ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.
2 \times 3 $2 \times 3$
2^{34} $2^{34}$
a_{i-1} $a_{i-1}$
\frac{2}{3} $\frac{2}{3}$
\sqrt{2} $\sqrt{2}$
\sum_{i=1}^3 $\sum_{i=1}^3$
\sin \theta $\sin \theta$
\boxed{123} $\boxed{123}$