say you are multiplying integers from 1 to 1000 and you want to count the number of "unique" elements. How would you do that? Is there a closed form expression for that? counting the unique or non-unique elements is the same since we know the total number of elements and can get the unique or non-unique by simple substraction. an example of unique element is 2*3 because there is only one way to generate it by multiplication. But 24 is a non-unique element since there are few ways to generate it (3*8, 2*12, 6*4...) and you don't want to count it in as many ways as you can generate it or you simply want to count it once. In other words, a 10*10 matrix will have 100 elements but we want to know how many of those 100 are unique and how many are non unique.