Properties of numbers Let $n$ be any natural number such that $n=p_1^{e_1}p_2^{e_2}\ldots p_r^{e_r}$. if  $n-(e_1+1)(e_2+1)\ldots (e_r+1)=1$, then n=3 or n=4. Is there any general formala, i.e what are the natural numbers such that $n-(e_1+1)(e_2+1)\ldots (e_r+1)=k$, where k is any natural number?
 A: $(e_1+1)(e_2+1)\cdots(e_r+1)$ is $d(n)$, the number of divisors of $n$. The number of solutions to $n-d(n)=k$, $k=0,1,2,\dots$, is tabulated at the Online Encyclopedia of Integer Sequences. There isn't much information about the sequence there, and that and its irregularities suggest that there's no general formula for the natural numbers with $n-d(n)=k$. 
A: Put $(e_1+1)(e_2+1)\ldots (e_r+1)=t$.
If $f_1$ is the number of $e_i=1$ then each contributes $(1+1)$ to the product $t$, so the total contribution to $t$ is $(1+1)^{f_1}$
If $f_2$ is the number of $e_i=2$ then each contributes $(1+2)$ to the product $t$, so the total contribution to $t$ is $(1+2)^{f_2}$
If $f_j$ is the number of $e_i=j$ then each contributes $(1+j)$ to the product $t$, so the total contribution to $t$ is $(1+j)^{f_j}$
So $t=(1+1)^{f_1}(1+2)^{f_2}\ldots (1+j)^{f_j}$
$$t=\prod_{j}\big((1+j)^{f_j}\big)\tag1$$
$$k=n-t$$
Example. $$n=1080450=(2)(3^2)(5^2)(7^4)$$
$$t=(1+1)^1(1+2)^2(1+4)^1=(2)(3)^2(5)=90$$
$$k=n-t=1080360$$ 
