I have a number that is perfect square, for example 36, and I have all prime divisors of this number 2,2,3,3. How many ways do we have to get 36 from divisors if we need to multiply k(from 2 to 1000) elements? (repetition is allowed, order matters) For example, if k = 3: 1,6,6 - one way to get 36. In addition, we have upper limit for each of element of multiplication. For 36 it will be 6 for example. It means that we can use 1,6,6 combination but we can not use 1,9,4 because 9 > 6.
I've tried Stars and Bars method but it does not take into account upper limit. After that I found Extended stars-and-bars problem(where the upper limit of the variable is bounded) but the problem that each element in our multiplication can be combination of different prime numbers(not just only one)