Which of the following have exactly four factors?
15
27
8
If a number is the product of two distinct primes, then it will have exactly four factors.
For example, consider the number 6=2×3, where 2 and 3 are distinct primes. 6 has four factors in all - 1, 2, 3 and 6.
Also, if a number is a cube of a prime number, the number has exactly four factors.
For example, consider the number 8=2×2×2. 8 has four factors in all - 1, 2, 4 and 8.
Now, in the options given, 15 is the product of two prime numbers 3 and 5,
27 is the cube of 3 and
8 is the cube of 2.