101
0/320
Loading content...
A simple-factored number is a positive integer whose only prime divisors are from the set {2, 3, 5}. In other words, when performing the complete prime factorization of such a number, only these three primes may appear.
By this definition:
Given an integer n, determine whether it qualifies as a simple-factored number. Return true if the number meets the criteria, and false otherwise.
n = 6true6 = 2 × 3. Both 2 and 3 are in the allowed set {2, 3, 5}, so 6 is simple-factored.
n = 1true1 has no prime factors at all. Since there are no disallowed primes present, it is considered simple-factored by definition.
n = 14false14 = 2 × 7. Although 2 is allowed, the prime factor 7 is not in {2, 3, 5}, making 14 not simple-factored.
Constraints