Given a number N, the task is to check if N is a Myriagon Number or not. If the number N is an Myriagon Number then print “Yes” else print “No”.
Myriagon Number is a polygon with 10000 sides. The first few Myriagon numbers are 1, 10000, 29997, 59992, 99985, 149976 …
Input: N = 10000
Second Myriagon number is 10000.
Input: N = 300
- The Kth term of the Myriagon number is given as:
- As we have to check that the given number can be expressed as a Myriagon 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 Myriagon Number.
- Else N is not a Myriagon 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.
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.
Improved By : shubhamsingh84100