Given an integer N, the task is to check if it is a Heptadecagonal Number or not. If the number N is an Heptadecagonal Number then print “Yes” else print “No”.
Heptadecagonal Number is class of figurate number. It has 17-sided polygon called heptadecagon. The N-th heptadecagonal number counts the seventeen number of dots and all others dots are surrounding with a common sharing corner and make a pattern. The first few heptadecagonal numbers are 1, 17, 48, 94, 155, 231…
Input: N = 17
Second heptadecagonal number is 17.
Input: N = 30
- The Kth term of the heptadecagonal number is given as
- As we have to check that the given number can be expressed as a heptadecagonal number or not. This can be checked as follows –
- If the value of K calculated using the above formula is an integer, then N is a Heptadecagonal Number.
- Else N is not a Heptadecagonal Number.
Below is the implementation of the above approach:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Heptadecagonal number
- Find the sum of the first Nth Heptadecagonal Number
- Program to check whether a number is Proth number or not
- Program to check Strong Number
- Program to check if a given number is Lucky (all digits are different)
- Program to check if N is an Icosikaioctagonal Number
- Program to check if N is a Pentagonal Number
- Program to check Plus Perfect Number
- Recursive program to check if number is palindrome or not
- Program to check if N is a Centered nonadecagonal number
- Program to check if a number is divisible by any of its digits
- Program to check if a number is divisible by sum of its digits
- Program to check if N is a Centered Hexagonal Number
- Program to check if N is a Hexagonal Number or not
- Program to check if N is a Star Number
- Program to check if N is a Centered Octadecagonal number
- Program to check if N is a Centered heptagonal number
- Program to check if N is a Centered Octagonal Number
- Program to check if N is a Icosidigonal Number
- Program to check if N is a 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 email@example.com. 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.