# Pentatope number

Given a number n, the task is to write a program to find Nth pentatope number. A pentatope number is class of figurative number and can be represented as regular and discrete geometric patterns. In pascal triangle’s the number in the fifth cell of any row starting with 5-th term row 1 4 6 4 1 from right to left or left to right is **Pentatope number**.

**Examples :**

Input : 5

Output :70

Input :8

Output :1001

First few Pentatope numbers are:

1, 5, 15, 35, 70, 126, 210, 330, 495, 715, 1001………

Formula for Nth Pentatope number:

## C++

`// C++ Program to find the ` `// nth Pentatope Number ` `#include <bits/stdc++.h> ` `using` `namespace` `std; ` ` ` `// Function that returns nth ` `// pentatope number ` `int` `pentatopeNum(` `int` `n) ` `{ ` ` ` `return` `(n * (n + 1) * (n + 2) * (n + 3)) / 24; ` `} ` ` ` `// Drivers Code ` `int` `main() ` `{ ` ` ` `// For 5th PentaTope Number ` ` ` `int` `n = 5; ` ` ` `cout << pentatopeNum(n) << endl; ` ` ` ` ` `// For 11th PentaTope Number ` ` ` `n = 11; ` ` ` `cout << pentatopeNum(n) << endl; ` ` ` ` ` `return` `0; ` `} ` |

*chevron_right*

*filter_none*

## Java

`// Java Program to find the ` `// nth Pentatope Number ` `import` `java.io.*; ` ` ` `class` `GFG ` `{ ` ` ` `// Function that returns nth ` `// pentatope number ` `static` `int` `pentatopeNum(` `int` `n) ` `{ ` ` ` `return` `(n * (n + ` `1` `) * ` ` ` `(n + ` `2` `) * (n + ` `3` `)) / ` `24` `; ` `} ` `// Driver Code ` `public` `static` `void` `main (String[] args) ` `{ ` `// For 5th PentaTope Number ` `int` `n = ` `5` `; ` `System.out.println(pentatopeNum(n)); ` ` ` `// For 11th PentaTope Number ` `n = ` `11` `; ` `System.out.println(pentatopeNum(n)); ` ` ` `} ` `} ` ` ` `// This code is contributed by m_kit ` |

*chevron_right*

*filter_none*

## Python3

`# Python3 program to find ` `# nth Pentatope number ` ` ` `# Function to calculate ` `# Pentatope number ` `def` `pentatopeNum(n): ` ` ` ` ` `# Formula to calculate nth ` ` ` `# Pentatope number ` ` ` `return` `(n ` `*` `(n ` `+` `1` `) ` `*` ` ` `(n ` `+` `2` `) ` `*` ` ` `(n ` `+` `3` `) ` `/` `/` `24` `) ` ` ` `# Driver Code ` `n ` `=` `5` `print` `(pentatopeNum(n)) ` `n ` `=` `11` `print` `(pentatopeNum(n)) ` ` ` `# This code is contributed ` `# by ajit. ` |

*chevron_right*

*filter_none*

## C#

`// C# Program to find the ` `// nth Pentatope Number ` `using` `System; ` ` ` `class` `GFG ` `{ ` ` ` `// Function that returns ` `// nth pentatope number ` `static` `int` `pentatopeNum(` `int` `n) ` `{ ` ` ` `return` `(n * (n + 1) * ` ` ` `(n + 2) * (n + 3)) / 24; ` `} ` ` ` `// Driver Code ` `static` `public` `void` `Main(String []args) ` `{ ` ` ` `// For 5th PentaTope Number ` `int` `n = 5; ` ` ` `Console.WriteLine(pentatopeNum(n)); ` ` ` `// For 11th PentaTope Number ` `n = 11; ` ` ` `Console.WriteLine(pentatopeNum(n)); ` `} ` `} ` `// This code is contributed by Arnab Kundu ` |

*chevron_right*

*filter_none*

## PHP

`<?php ` `// PHP Program to find the ` `// nth Pentatope Number ` ` ` `// Function that returns ` `// nth pentatope number ` `function` `pentatopeNum(` `$n` `) ` `{ ` ` ` `return` `(` `$n` `* (` `$n` `+ 1) * ` ` ` `(` `$n` `+ 2) * ` ` ` `(` `$n` `+ 3)) / 24; ` `} ` ` ` `// Driver Code ` ` ` `// For 5th PentaTope Number ` `$n` `= 5; ` `echo` `pentatopeNum(` `$n` `), ` `"\n"` `; ` ` ` `// For 11th PentaTope Number ` `$n` `= 11; ` `echo` `pentatopeNum(` `$n` `), ` `"\n"` `; ` ` ` `// This code is contributed ` `// by aj_36 ` `?> ` |

*chevron_right*

*filter_none*

**Output :**

70 1001

**Reference:**https://en.wikipedia.org/wiki/Pentatope_number

## Recommended Posts:

- Pentatope number
- Program to print pentatope numbers upto Nth term
- Count number of triplets with product equal to given number with duplicates allowed
- Count number of trailing zeros in Binary representation of a number using Bitset
- 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
- Given number of matches played, find number of teams in tournament
- Number of times the largest perfect square number can be subtracted from N
- Check if a number is divisible by all prime divisors of another number
- Represent a number as a sum of maximum possible number of Prime Numbers
- Find the total number of composite factor for a given number
- Number of times a number can be replaced by the sum of its digits until it only contains one digit
- Find count of digits in a number that divide the number
- Program to calculate the number of odd days in given number of years
- Build Lowest Number by Removing n digits from 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 contribute@geeksforgeeks.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.