ultrafilter:
That problem is trivial, actually. Did you mean to say, “It’s equivalent to determining how many divisors with a set number of prime factors (not necessarily distinct) a number has given its prime factorization.”
In other words, for example, 12 = (2^2)3, has 32 = 6 factors (1, 2, 3, 4, 6, and 12), but we can also talk about the factors of 12 with, say,
Exactly zero prime factors: 1
Exactly one prime factor: 2 and 3
Exactly two prime factors: 4 and 6
Exactly 3 prime factors: 12
I think that’s what you meant to say. So the OP would be equivalent to having a number with a prime factorization such as:
(2^2) * 3 * 5 * 7 * 11 * 13 * 17 * 19 * 23 * 29
and asking how many divisors with exactly seven prime factors that number has.
The best and most general way I can think of for this type of problem is to use generating functions.
For the example in the OP, do it like this: For each distinct object, we need a polynomial of the form:
1 + x + x^2 + … + x^n,
where n is the number of times the object is repeated in the original group.
For example, for the OP’s problem, the polynomial for A would be:
1 + x + x^2
and the polynomials for B through J would each be
1 + x.
Multiply all your polynomials together to get your generating function:
(1 + x + x^2) * (1 + x)^9
Since we want to know how many ways to select seven objects, our answer is the coefficient of x^7 in our generating function (which is 246 if I didn’t screw that up).
Do you see how that works?