Number theory problem on divisors! 
For any positive integer $n$, let $d(n)$ denote the number of positive divisors of $n$ (including $1$ and itself). Determine all positive integers $k$ such that $$\frac{d\left(n^2\right)}{d(n)} = k$$ for some $n$.

Please help me solve this number theory problem. I have tried a lot and found two values of k, $1$ and $3$, but I don't know if there are some others.
 A: All odd numbers and only them are representable in the form $d(n^2)/d(n)$. But the proof is tricky! 
It is clear that no even number is representable as the numerator is always odd. 
For $k$ odd we proceed by induction, clearly $1 = d(1^2)/d(1)$ so $1$ is representable. Now suppose that $k>1$ and that all odd integers up to $k-2$ are representable then if $2^a$ is the largest power of $2$ that divides $k+1$, write 
$$ k = 2^at-1 $$
with $t$ odd and $a \ge 1$, then 
$$ (2^a-1)k = 2^{a+1}(2^{a-1}t-\tfrac{t+1}2)+1 = 2^{a+1}b+1$$
whith $b = 2^{a-1}t-\tfrac{t+1}2$. Now we see that $2b+1 = (2^a-1)t$ and so:
$$ \frac{2^{a+1}b+1}{2^ab+1}\cdot \frac{2^{a}b+1}{2^{a-1}b+1}\cdot \dots \cdot \frac{2^2b + 1}{2b+1} = \frac{(2^a-1)k}{(2^a-1)t} = \frac{k}{t}$$
As $t < k$ is odd, using the induction hypothesis we can find $m$ such that 
$$ t = \frac{d(m^2)}{d(m)} $$
But then chosing primes $p,q,\dots,s$ coprime with $m$ we find that
$$ n = p^{2^{a}b}q^{2^{a-1}b}\dots s^{2b} m $$ 
verifies
$$ \frac{d(n^2)}{d(n)} = \frac{d(p^{2^{a+1}b}q^{2^{a}b}\dots s^{2^2 b})}{d(p^{2^{a}b}q^{2^{a-1}b}\dots s^{2 b})} \cdot \frac{d(m^2)}{d(m)} = \frac{k}t\cdot t = k$$
and the proof is complete!.
A: Note that if the prime decomposition of $n$ is $\prod\limits_{i\in I} p_i^{a_i}$, then we have the fraction $$\prod\limits_{i\in I}\frac{2a_i+1}{a_i+1}$$
Note that in particular, the numerator must always be odd, which implies that so must the denominator for the fraction to be integral. So, $a_i$ must be even for all $i$. This implies that $n$ must be a perfect square. 
So, if we let $2b_i=a_i$ for every $a_i$, then we get $$\prod\limits_{i\in I}\frac{4b_i+1}{2b_i+1}$$
Next, I want to show that we can express any odd number as one of these fractions. Note clearly that if any odd number can be expressed as one of these fractions, then any power of it can as well (take the same prime decomposition, but repeat it $n$ times with different primes).
So, we simply need to show that this can be done for any odd prime. We can prove this via strong induction. Suppose prime $p$ is of the form $4n+1$ for some $n\in\mathbb N$. Then, we let $b_1=n$, and then we note that the denominator will be of the form $2b_i+1$, which we know that we can express as a result of the product. So, we are done.
The logic for primes of the form $4n+3$ is trickier. To finish later.
