I'm stuck with this counting problem: I have an expression: $T = (N!) \times (N!) / D$ where, $D \in [1 - N!]$, i.e. $D$ takes all values from $1$ to $N!$ and I'm to count the number of points where $T$ comes out to be a whole number (a positive integer).
For example, for $N=3$: $ D \in \{1, 2, 3, 4, 5, 6\} $ and $T$ comes out to be a whole number for $D \in \{1, 2, 3, 4, 6\}$, i.e. for 5 values.
I'd like to develop an efficient algorithm to count, since $N$ can be a large number.
I believe in the numerator we have the possible factors broken up as $N!$ 's and we have to start making products up till $N!$ from them and count all the distinct ones. That seems about one way to do it. Please help me unwrap it or provide any hints/pointers in the right directions to do it as efficiently as possible as $N$ here happens to be a huge value.