I am talking about something like this:
$
N = \{2, 3, 3, 3, 5, 5, 7\}$
$ n = 7$
$ s=3 $
$t=2$
In my case specifically, those numbers in $N$ are the prime factors of a number $Z$ repeated the number of times they divide $Z$.
And what I am looking for is to find all the numbers (non-prime included), that divide our number perfectly, from the combinations of these numbers in $N$.
I know I have to find the combination of elements in $N$ taken $i$ at a time where $i$ goes from $1$ to $7$ (# elements in $N$). Also the repeated elements are to be treated specially. I could find that in this particular case manually but I am dealing with large $N$ such that total combinations is at least $500$.
I want to be able to express the solution in a generalized formula. But, I am having hard time doing so. The standard combination formula $n\mathrm{C}r$ does not treat repeated numbers "specially" enough. Would anyone having more grasp into this help me please.
For a number $Z$ expressible in terms of it's $k$ prime factors:
$$Z = p_{1}^{r_{1}}p_{2}^{r_{2}}...p_{k}^{r_{k}}$$
Each factor can be formed by selecting a set of prime factors as follows:
...
So the number of factors is given by:
$$\left(r_{1}+1\right)\left(r_{2}+1\right)...\left(r_{k}+1\right)$$
For the example you give we enumerate factors of $9450$: $$\left(1+1\right)\left(3+1\right)\left(2+1\right)\left(1+1\right) = 2\times 4 \times 3 \times 2 = 48$$
which also includes $1$ and itself.
You should make it clear in the question whether you are trying to enumerate factors or whether you are attempting to list them. If the latter then you will need to work through them systematically.