The following example illustrates the concept of reducibility. Consider three problems, A, B, and C:
In this example A C, and B C. Why?
To find if n is a prime, we attempt to divide it by 2, 3, 5, etc. The smallest integer that divides n also answers A.
Thus the solution of Smallestfactor(n) tells us that n is not a prime.
To see how B C we need a simple algorithm that counts the number of distinct divisors of n using C.