Given a positive integer N. The task is to check if N is an Achilles number or not. Print ‘YES’ if N is an Achilles number else print ‘NO’.
Achilles number: In Mathematics, an Achilles number is a number that is powerful ( A number n is said to be Powerful Number if for every prime factor p of it, p2 also divides it ) but not a perfect power.
The first few Achilles number are-
72, 108, 200, 288, 392, 432, 500, 648, 675, 800, 864, 968, 972, 1125, 1152, 1323
Input : 72
Output : YES
72 is powerful as 6 and 36 both divide it and it is not perfect square.
Input : 36
Output : NO
Explanation : 36 is powerful number but is perfect power.
- Check If the given number n is a powerful number or not. To check if a number is powerful or not refer this.
- Check if n is a perfect power or not. To know various approaches to check if a number is perfect power or not – refer this.
- If n is powerful but not perfect then, n is an Achilles Number
Below is the implementation of above idea.
- Check if a number is divisible by all prime divisors of another number
- Check whether all the rotations of a given number is greater than or equal to the given number or not
- Check if a number has same number of set and unset bits
- Check if a number with even number of digits is palindrome or not
- Program to check whether the given number is Buzz Number or not
- Program to check whether a number is Proth number or not
- Check if a number is an Unusual Number or not
- Check if a number is a Trojan Number
- Check Whether a number is Duck Number or not
- PHP | Check if a number is Perfect number
- Check if a number is a Krishnamurthy Number or not
- Check if given number is Emirp Number or not
- Check whether the given number is Euclid Number or not
- PHP | Check if a number is armstrong number
- Check if a number is a Mystery 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.