A number is said to be Surd if its square root, cube root, etc are not integers. For example, 9 is not a Surd as square root of 9 is 3, but 5 is Surd as square root of 5 is not integer. Similarly 8 is not a Surd (Cube root of 8 is integer), but 7 is.
Given a range, find if it is Surds or not
Input : 4 Output : No 4 is not a Surd number as its square root is an integer. Input : 5 Output : Yes 5 is a Surd number as its square root is not an integer. Input : 8 Output : No 8 is not a Surd number as cube root of 8 is an integer.
The idea is to try every power of all numbers from 2 to √n and check if any power is equal n or not.
- Count number of trailing zeros in Binary representation of a number using Bitset
- Count number of triplets with product equal to given number with duplicates allowed
- Find minimum number to be divided to make a number a perfect square
- Smallest number dividing minimum number of elements in the Array
- Largest number dividing maximum number of elements in the array
- Smallest number dividing minimum number of elements in the array | Set 2
- Given number of matches played, find number of teams in tournament
- Number of times the largest perfect square number can be subtracted from N
- Number of possible permutations when absolute difference between number of elements to the right and left are given
- Find the number of positive integers less than or equal to N that have an odd number of digits
- Number of ways to split a binary number such that every part is divisible by 2
- Querying maximum number of divisors that a number in a given range has
- Count number of ways to divide a number in 4 parts
- Count the number of operations required to reduce the given number
- Find the number of ways to divide number into four parts such that a = c and b = d
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.