Given an integer N, the task is to check if it is a Icosidigonal Number or not. If the number N is an Icosidigonal Number then print “Yes” else print “No”.
The polygon has many gons, depends on their gonal number series. In mathematics, there are a number of gonal numbers and the Icosidigonal Number is one of them and these numbers have 22 -sided polygon(icosidigon). An Icosidigonal Number belong to the class of figurative number. They have one common dots points and other dots pattern is arranged in an n-th nested Icosidigon pattern.
The first few Icosidigonal numbers are 1, 22, 63, 124, 205, 306…
Input: N = 22
Second Icosidigonal number is 22.
- The Kth term of the Icosidigonal number is given as
- As we have to check that the given number can be expressed as a Icosidigonal 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 Icosidigonal Number.
- Else N is not a Icosidigonal Number.
Below is the implementation of the above approach:
- Write a program to calculate pow(x,n)
- Write a program to reverse digits of a number
- Program to find whether a no is power of two
- Write an Efficient Method to Check if a Number is Multiple of 3
- Program to find parity
- Write an Efficient C Program to Reverse Bits of a Number
- Write a program to print all permutations of a given string
- Write a program to add two numbers in base 14
- Minimum number of jumps to reach end
- Find minimum number to be divided to make a number a perfect square
- Find whether a given number is a power of 4 or not
- Print all combinations of points that can compose a given number
- Program for Fibonacci numbers
- Check if a number is multiple of 5 without using / and % operators
- Check whether a given point lies inside a triangle or not
- Given a number, find the next smallest palindrome
- Check divisibility by 7
- Count the number of possible triangles
- Select a random number from stream, with O(1) space
- Program to find amount of water in a given glass