Given a number of the form P_{1}^{a}.P_{2}^{b}..., then what are the total factors? By using basic combinatorics it is (a+1).(b+1)... So, If the canonical form has more than 2 primes, then total number of factors is definately not a prime because it has atleast two factors which are not 1 or the number itself. However, if there is only one prime in the canonical form you have to put an additional prime check on a+1.
However, I think this question can be solved using a slightly simple approach. You can count the total number of factors of a number in sqrt(N). Then check if this number is a prime, build a Linear Sieve in the pre-processing step.