Given a number N, the task is to find the Nth Pentadecagonal number.
A Pentadecagonal number is a figurate number that extends the concept of triangular and square numbers to the pentadecagon(a 15-sided polygon). The Nth pentadecagonal number counts the number of dots in a pattern of N nested pentadecagons, all sharing a common corner, where the ith tridecagon in the pattern has sides made of ‘i’ dots spaced one unit apart from each other. The first few Pentadecagonal numbers are 1, 15, 42, 82, 135, 201, 280 …
Input: N = 2
The second Pentadecagonal number is 15.
Input: N = 6
Approach: The Nth Pentadecagonal number is given by the formula:
Below is the implementation of the above approach:
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Centered Pentadecagonal Number
- Program to check if N is a Pentadecagonal Number
- Find the sum of the first Nth Centered Pentadecagonal Number
- Program to check if N is a Centered Pentadecagonal Number
- Number of factors of very large number N modulo M where M is any prime number
- 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
- Count number of triplets with product equal to given number with duplicates allowed
- Find the largest number smaller than integer N with maximum number of set bits
- Largest number dividing maximum number of elements in the array
- Smallest number dividing minimum number of elements in the array | Set 2
- Smallest number dividing minimum number of elements in the Array
- Number of possible permutations when absolute difference between number of elements to the right and left are given
- Minimum divisor of a number to make the number perfect cube
- Given number of matches played, find number of teams in tournament
- Find smallest possible Number from a given large Number with same count of digits
- Previous perfect square and cube number smaller than number N
- Find the number of positive integers less than or equal to N that have an odd number of digits
- Minimum number of swaps required to make a number divisible by 60
- Number of ways to split a binary number such that every part is divisible by 2
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.