# For the divisor function is $d(n^2)$ related to $d(n)$ knowing also n?

The divisor function d(n) is defined as 'the number of positive divisors of n (including 1 and n)' according to Underwood Dudley.

Is the divisor function $$d(n^2)$$ related to $$d(n)$$?

for example

d(10)=4 and $$d(10^2)$$=9
or d(14)=4 and $$d(14^2)=9$$

So can one find the $$d(n^2)$$ from knowing only d(n) and n through some relation or function?

Has any work been done on this problem?

• Just to be clear, $d$ doesn't count the number itself, so for any prime it gives $1$? – Arthur Aug 3 at 13:39
• @Arthur okay thanks I'll remove 1 from each – onepound Aug 3 at 13:40
• You should get $d(n^2) = 2^k d(n)$, where $k$ is the number of "distinct" primes in $n$ – rsadhvika Aug 3 at 13:40
• @rsadhvika so for n=100 $2^2*2=8$? – onepound Aug 3 at 13:42
• I don't understand that function $d$. – ajotatxe Aug 3 at 13:45

There is no direct way to get from the value of $$d(n)$$ to the value of $$d(n^2)$$ without involving $$n$$. For instance, we have $$d(6)=d(8)=3$$, but $$d(36)=8$$ while $$d(64)=6$$.

Your divisor function is closely related to prime factorisations. If $$n=2^{e_2}\cdot3^{e_3}\cdot5^{e_5}\cdots$$ (where most of the $$e_k$$ are $$0$$), then $$d(n)=(e_2+1)(e_3+1)(e_5+1)\cdots-1$$ Squaring $$n$$ doubles all the $$e_k$$. For the example above, we have $$d(6)=(1+1)(1+1)-1=3 d(8)=(3+1)-1=3\\ d(36)=(2+1)(2+1)-1\\ d(64)=(6+1)-1=6$$ So for each way you can write $$d(n)+1$$ as a product of natural numbers greater than $$1$$, there is a different value to $$d(n^2)$$.

• my question had some ambiguity when you say "There is no direct way to get from the value of d(n) to the value of d(n2) without involving n" does this change if one knows n as I had intended the question to be? – onepound Aug 3 at 13:51
• @onepound If we know $n$, then we may calculate $d(n^2)$ without involving $d(n)$. I don't know a way to calculate $d(n^2)$ from $n$ and $d(n)$ which involves $d(n)$ in any crucial way, but there may be one. – Arthur Aug 3 at 13:54

Let $$n=\prod\limits_{i=1}^{\omega(n)}p_i^{a_i},\,a_i>0$$ so $$d(n)=\prod\limits_{i=1}^{\omega(n)}(1+a_i)$$. Then $$n^2=\prod\limits_{i=1}^{\omega(n)}p_i^{2a_i}$$ so $$d(n^2)=\prod\limits_{i=1}^{\omega(n)}(1+2a_i)$$ which cannot be expressed purely in terms of $$d(n)$$.

• okay so the answer is no given your proof. – onepound Aug 3 at 13:47
• @onepound No, he gives the answer to your question. The answer is "no" and he proved it. – B. Goddard Aug 3 at 13:53
• @B. Goddard yes purely in terms of d(n) it cannot be done that was obvious empirically in the example I gave above I meant including n too. – onepound Aug 3 at 14:00