Given an integer N, the task is to check if N is a Hexadecagonal Number or not. If the number N is an Hexadecagonal Number then print “Yes” else print “No”.
Hexadecagonal Number is class of figurate number and a perfect squares. It has 16-sided polygon called Hexadecagon or Hexakaidecagon. The nth Hexadecagonal Number counts the sixteen number of dots and all others dots are surrounding to its successive layer.The first few Hexadecagonal Numbers are 1, 16, 45, 88, 145, 216…
Input: N = 16
Second hexadecagonal number is 16.
Input: N = 30
- The Kth term of the hexadecagonal number is given as
- As we have to check that the given number can be expressed as a Hexadecagonal Number or not. This can be checked as:
- If the value of K calculated using the above formula is an integer, then N is a Hexadecagonal Number.
- Else N is not a Hexadecagonal 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.
- Program to check if N is a Centered Hexadecagonal Number
- Hexadecagonal number
- Centered Hexadecagonal Number
- Find the sum of the first Nth Centered Hexadecagonal 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
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.