First few Blum Integers are 21, 33, 57, 69, 77, 93, 129, 133, 141, 161, 177, …
Note: Because of the condition that both the factors should be semi-primes, even numbers can not be Blum integers neither can be the numbers below 20,
So we have to check only for an odd integer greater than 20 that if it is a Blum Integer or not.
Input: 33 Output: Yes Explanation: 33 = 3 * 11, 3 and 11 are both semi-primes as well as of the form 4t + 3 for t = 0, 2 Input: 77 Output: Yes Explanation: 77 = 7 * 11, 7 and 11 both are semi-prime as well as of the form 4t + 3 for t = 1, 2 Input: 25 Output: No Explanation: 25 = 5*5, 5 and 5 are both semi-prime but are not of the form 4t + 3, Hence 25 is not a Blum integer.
Approach: For a given odd integer greater than 20, we calculate the prime numbers from 1 to that odd integer. If we find any prime number that divides that odd integer and its quotient both are prime and follow the form 4t + 3 for some integer, then the given odd integer is Blum Integer.
Below is the implementation of above approach :
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- Minimum decrements to make integer A divisible by integer B
- Convert given integer X to the form 2^N - 1
- Find One's Complement of an Integer
- Smallest integer which has n factors or more
- Greatest Integer Function
- Minimum positive integer value possible of X for given A and B in X = P*A + Q*B
- Check if two Integer are anagrams of each other
- Square root of an integer
- Replace all ‘0’ with ‘5’ in an input Integer
- Find whether a given integer is a power of 3 or not
- Determine whether the given integer N is a Peculiar Number or not
- Find closest integer with the same weight
- Convert a String to an Integer using Recursion
- Integer part of the geometric mean of the divisors of N
- Check if the given array contains all the divisors of some integer
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.