Given a number n, find the nth Pentatope number. A pentatope number is represented by the fifth number in any row of Pascal’s Triangle. As it is fifth number, it should start from row having at least 5 numbers. So, it starts from row 1 4 6 4 1. The formula for the nth pentatopic number is: n (n+1) (n+2) (n+3) / 24
Starting Pentatope numbers are : 1, 5, 15, 35, 70, 126, 210, 330, 495…..
In the above figure, red color circled numbers are pentatope numbers.
Input : 4 Output : 35 Input : 8 Output : 330
Below is the implementation for nth Pentatope Number :
7th Pentatope number : 210 12th Pentatope number : 1365
References : https://en.wikipedia.org/wiki/Pentatope_number/
- Pentatope number
- Program to print pentatope numbers upto Nth term
- Count number of trailing zeros in Binary representation of a number using Bitset
- Count number of triplets with product equal to given number with duplicates allowed
- Find minimum number to be divided to make a number a perfect square
- Number of possible permutations when absolute difference between number of elements to the right and left are given
- Number of times the largest perfect square number can be subtracted from N
- Given number of matches played, find number of teams in tournament
- Find count of digits in a number that divide the number
- Queries on sum of odd number digit sums of all the factors of a number
- Find the number of ways to divide number into four parts such that a = c and b = d
- Minimum number of given powers of 2 required to represent a number
- Find the maximum number of composite summands of a number
- Program to calculate the number of odd days in given number of years
- Find maximum number that can be formed using digits of a given 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.