Given a positive integer N. The task is to check if N is an unusual number or not. Print ‘YES’ if M is an unusual number else print ‘NO’.
Unusual number : In Mathematics, an unusual number is a natural number whose greatest prime factor is strictly greater than square root of n.
The first few unusual numbers are –
2, 3, 5, 6, 7, 10, 11, 13, 14, 15, 17, 19, 20, 21, 22, 23, 26, 28, 29, 31, 33, 34, 35, 37, 38, 39, 41, 42, 43, 44, 46, 47, 51
Input : N = 14 Output : YES Explanation : 7 is largest prime factor of 14 and 7 is strictly greater than square root of 14 Input : N = 16 Output : NO Explanation : 2 is largest prime factor of 16 and 2 is less than square root of 16 ( i.e 4 ).
- Find the largest prime factor of the given number N. To find the largest prime factor of N refer this .
- Check if the largest prime factor of N is strictly grater than square root of N.
- If ‘YES’ then N is an Unusual number otherwise Not.
Below is the implementation of the above approach:
- 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
- Program to check whether a number is Proth number or not
- Check if a number with even number of digits is palindrome or not
- Check if a number is a Mystery Number
- Check if a number is Triperfect Number
- Check Whether a number is Duck Number or not
- Check whether the given number is Euclid Number or not
- Check if given number is Emirp Number or not
- Check whether a number is Non-hypotenuse number
- Check if a number is an Achilles number or not
- Check if a number is a Krishnamurthy Number or not
- Check if a number is a power of another number
- How to check if a given number is Fibonacci number?
- Check if a number is a Trojan 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.
Improved By : Harshit Saini