The number of divisors for some number with prime factorization where are distinct primes, is given by

In other words, you take the exponents, add one, and multiply. (This can be shown easily enough if you view each distinct prime as a certain color ball, then for each color ball you can choose either none of them, or one, or two, or ..., up to ; then each color of ball can be chosen ways, the product of which gives you the total ball groupings possible.) So for example, should have divisors (including and itself). The divisors of are , which number .

Then for each divisor, it has another divisor to which it multiplies to give the number. For instance, the is paired with , with , and so on. Then the total number of pairs in the example for would be . The exception is when a number is a square, in which case it would have an odd number of divisors, the one in the middle when ordered would be the square root. For instance, the divisors of are , the middle number being paired with itself.

So in order to have exactly pairings as described in the problem, we need the divisor function to give us either divisors, or divisors. Then the increment of each exponent in the prime factorization of such a number must multiply together to give us or . Thus our goal is to see how many ways we can make a product of or , then set those factors (minus ) as the exponents to primes, and see which one is the smallest.

Then what are all the ways to make or ? We build quite an extensive list, and I will write them in the form , meaning that . Of course is prime so there is only one way to make it, so I will make it first in the list, followed by ways to make .

I believe that is all the ways to get either or when multiplied, then the sets of exponents will be all these minus , giving us

The number we are looking for must have these exponents in its factorization, and since we are looking for the smallest number, the smallest prime will be assigned the highest exponent, and then we can easily compare two by two until we have the victor. For odd numbers, the smallest prime is , and after comparing the resulting numbers, we discover that results in the smallest odd number Then the smallest odd number with exactly "product pairs" is .

The same process is done for even numbers with the only difference being that the smallest prime factor is , therefore we take each exponents set, assign them in decreasing order to increasing primes, and compare them with each other. In this case the smallest value comes out from the set to be . So the smallest even number, actually smallest positive number altogether which can be factored into exactly product pairs is .