Counting the number of pairs of $(i,j)$ such that $\operatorname{lcm}(i,j)=n$ Pairs $(i,j)$ such that $\operatorname{lcm}(i,j)=n$
how many pair $(i,j)$ can be formed such that $\operatorname{lcm}(i,j)=n$. here  $i\leq n$ and $j\leq n$.
here $n$ is a integer number less than $10^{14}$.
 A: First solution
Let 
$$A=\left\{(p,q)\big/ \text{lcm}(p,q)=n\right\}$$
let $n=\prod_{i=1}^rp_i^{\alpha_i}$ and for every $(p,q)$ we correspond the tuples $\left((a_1,\ldots,a_r),(b_1,\ldots,b_r)\right)$ such that $p=\prod_{i=1}^rp_i^{a_i}$ and $q=\prod_{i=1}^rp_i^{b_i}$ we can conclude in terms of cardinals that:
$$card(A)=card\left(\left\{\left((a_1,\ldots,a_r),(b_1,\ldots,b_r)\right)\Big/\forall i \max(a_i,b_i)=\alpha_i\text{ and }0\leq a_i,b_i\leq \alpha_i\right\}\right) $$
but for every $i$ there is exactly $2\alpha_i+1$ possible choices of $(a_i,b_i)$  which are:
$$(0,\alpha_i),(1,\alpha_i),\ldots,(\alpha_i-1,\alpha_i),(\alpha_i,\alpha_i),(\alpha_i,\alpha_i-1),\cdots,(\alpha_i,0),(\alpha_i,0)$$
finally :
$$card(A)=\prod_{i=1}^r(2\alpha_i+1)=d(n^2) $$
Second solution
With the same set as above we know that every couple $(p,q)$ such that $lcm(p,q)=n$ is equivalent of a triple of elements $(d,a,b)$ such that $d=\gcd(p,q), 1=\gcd(a,b)$ and $\frac{n}{d}=ab$ so:
$$card(A)= \left(\left \{(d,a,b)\big/ d|n, \gcd(a,b)=1\text{ and } \frac{n}{d}=ab \right\}\right) $$
But we can easily observe that the number of couples $(a,b)$ such that $\gcd(a,b)=1, ab=k$ is $2^{\omega(k)}$ with $\omega(k)$ is the number of prime factors of $k$ . Finally we have the beautiful formula :
$$card(A)=\sum_{d|n}2^{\omega(\frac{n}{d})} $$ 
A: This can get you started.
Factor $n$ into its prime decomposition:
$$n=p_1^{a_1}p_2^{a_2}\dots p_k^{a_k}$$
All the possible $i$'s where $\operatorname{lcm}(i,j)=n$ are given by
$$i=p_1^{b_1}p_2^{b_2}\dots p_k^{b_k}$$
where $0\le b_r\le a_r$. This gives $a_r+1$ choices for the exponent for $p_r$, and the choices are independent for each $r$, so the number of possible choices for $i$ is
$$(a_1+1)(a_2+1)\ldots (a_k+1)$$
Continue from there. The main difficulty is that the number of possible choices for $j$ depends on the particular $i$.
Show us some of the work you do from here, and we can give you more ideas.
A: By way of adding commentary to  the answer by @Elaqqad I would like to
present a proof that indeed
$$\sum_{d|n} 2^{\omega(d)} = d(n^2).$$
This can be done using Dirichlet series and Euler products.
We have for $$2^{\omega(n)}$$ the Euler product
$$\prod_p 
\left(1 + \frac{2}{p^s} + \frac{2}{p^{2s}} + \frac{2}{p^{3s}}
+\cdots\right).$$
which is
$$\prod_p \left(-1 + 2\frac{1}{1-1/p^s}\right)
= \prod_p \frac{-1+1/p^s+2}{1-1/p^s}
\\ = \prod_p \frac{1+1/p^s}{1-1/p^s}
= \prod_p \frac{1-1/p^{2s}}{(1-1/p^s)^2}
= \frac{\zeta(s)^2}{\zeta(2s)}.$$
Therefore the Euler product for the LHS is
$$\frac{\zeta(s)^3}{\zeta(2s)}.$$
On the other hand, we get for $$d(n^2)$$ the Euler product
$$\prod_p 
\left(1 + \frac{3}{p^s} + \frac{5}{p^{2s}} + \frac{7}{p^{32}} 
+ \cdots\right)$$
which is
$$\prod_p \left(\sum_{q\ge 0} \frac{2q+1}{p^{qs}} \right)
= \prod_p \frac{1+1/p^{s}}{(1-1/p^{s})^2}
= \prod_p \frac{1-1/p^{2s}}{(1-1/p^{s})^3}
= \frac{\zeta(s)^3}{\zeta(2s)}$$
and we have  equality of the Dirichlet series  and their coefficients.
Since  $\omega(n) <\log_2 n$  and since  $d(n) \in  o(n^\epsilon)$ the
half-plane of convergence for these two is $\Re(s)> 2.$
Remark. If  we want to be  rigorous about it, we  have equality of
the coefficients  of the Dirichlet  series in the intersection  of the
two  half-planes  of  convergence  because for  the  Dirichlet  series
$\Lambda(s) = \sum_{n\ge 1} \frac{\lambda_n}{n^s}$ we have
$$\lambda_n = \frac{1}{2\pi i} 
\int_{c-i\infty}^{c+i\infty} \Lambda(s) n^{s-1} ds.$$
