- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Program to print pentatope numbers upto Nth term in C
Program Description
A pentatope number is a number in the fifth cell of any row of Pascal's triangle starting with the 5-term row 1 4 6 4 1 either from left to right or from right to left.
The first few numbers of this kind are
1, 5, 15, 35, 70, 126, 210, 330, 495, 715, 1001, 1365
Pentatope numbers belong in the class of figurate numbers, which can be represented as regular, discrete geometric patterns. The formula for the nth pentatopic number is
$$\left(\begin{array}{c}n+3\ 4\end{array}\right)=\left(\frac{n(n+1)+(n+2)+(n+3)}{24}\right)=\left(\frac{n^2}{4!}\right)$$
Algorithm
Accept the Nth Term from the User to find the Pentotope Numbers.
Use the formula
$$\left(\begin{array}{c}n+3\ 4\end{array}\right)=\left(\frac{n(n+1)+(n+2)+(n+3)}{24}\right)=\left(\frac{n^2}{4!}\right)$$
Example
/* Program to print pentatope numbers upto Nth term */ #include<stdio.h> int main() { int n, n1, nthterm, nthterm1, i; clrscr(); printf("
Please enter the nth term to print Pentatope: "); scanf("%d",&n); nthterm = n * (n + 1) * (n + 2) * (n + 3) / 24; printf("The Pentotpe Number is: "); printf("%d", nthterm); printf("
"); printf("Printing the Pentotope Numbers upto Nth Term"); printf("
Print Pentatope Numbers till the term: "); scanf("%d",&n1); printf("
"); printf("The Pentotope Numbers are:"); printf("
"); for (i = 1; i <= n1; i++){ nthterm1 = (i * (i + 1) * (i + 2) * (i + 3) / 24); printf("%d\t", nthterm1); } getch(); return 0; }
Output
- Related Articles
- C++ program to get the Sum of series: 1 – x^2/2! + x^4/4! -…. upto nth term
- C program to find nth term of given recurrence relation
- Program to find nth Fibonacci term in Python
- Program to find Nth term divisible by a or b in C++
- C++ Pentatope Number
- Program to print numbers columns wise in C
- Program to print a pattern of numbers in C++
- C++ program to find Nth term of series 1, 4, 15, 72, 420…
- C++ program to find Nth term of the series 1, 5, 32, 288 …
- C++ program to find Nth term of the series 1, 8, 54, 384…
- C++ program to find Nth term of the series 3, 14, 39, 84…
- C++ program to find nth term of the series 5, 2, 13 41,...
- Program to find Fibonacci series results up to nth term in Python
- Program to find nth term in Look and Say Sequence in Python
- C++ program to Find Nth term of the series 1, 1, 2, 6, 24…

Advertisements