Given a number X which represents the floor of a matchstick pyramid, write a program to print the total number of matchstick required to form pyramid of matchsticks of x floors.
Input : X = 1 Output : 3 Input : X = 2 Output : 9
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- First triangular number whose number of divisors exceeds N
- Centered triangular number
- Centered triangular number in PL/SQL
- Smallest triangular number larger than p
- Squared triangular number (Sum of cubes)
- Program to print triangular number series till n
- Triangular Numbers
- Sum of the series 1, 3, 6, 10... (Triangular Numbers)
- Program for triangular pattern (mirror image around 0)
- Recursive program to print triangular patterns
- Program to find the Volume of a Triangular Prism
- Program to calculate the Surface Area of a Triangular Prism
- Maximum height of triangular arrangement of array values
- Tetradecagonal number
- Icosagonal number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : jit_t