(i) Let n=p1a(1)⋯pra(r), we have
k=d(n2)/d(n)=(1+2a(1))⋯(1+2a(r))/[(1+a(1))⋯(1+a(r))]
Thus, k must be an odd number. Therefore, n must be a perfect square.
(ii) Now we prove that any odd number k can be expressed in this way. We use induction. When k=1, we can take n=1; when k=3, we can take n=(2⋅32)2. Hence, the conclusion holds for k=1,3. Assume that for all positive odd numbers k⩽4N+3(N⩾0), the conclusion holds. We will prove that for all positive odd numbers k⩽4(N+1)+3, the conclusion holds. This requires considering two cases.
(a) When k=4(N+1)+1, by the induction hypothesis and the fact that n must be a perfect square, there exists n1 such that 1+2(N+1)=d(n14)/d(n12). Now take n=n12p2(N+1), where the prime p is coprime with n1. We then have
k=4(N+1)+1=d(n2)/d(n)
(b) When k=4(N+1)+3, we have k=2lm−1,(2,m)=1,l⩾2. By the induction hypothesis and the fact that n must be a perfect square, there exists n1 such that m=d(n14)/d(n12). Take distinct primes p1,⋯,pl, all coprime with n1, and let 2β(j)=3j2l−jm−2(1⩽j⩽l−1), 2β(l)=3l−1m−1, n=n1p1β(1)⋯plβ(l). We then have
k=4(N+1)+3=d(n2)/d(n)
Therefore, for all positive odd numbers k⩽4(N+1)+3, the conclusion holds. Proof completed.