For computational reasons, I want to show that the following holds true:
Let $n_1,n_2,N\in \mathbb{N}$. One has $$\Large \sum_{a\mid \gcd(n_1,N)}\sum_{b\mid \gcd(n_2,\frac{n_1N}{a^2})} ab =\sum_{g\mid \gcd(n_1,n_2)}\sum_{d\mid \gcd(\frac{n_1n_2}{g^2},N)}gd. $$
It is true numerically, but I do not know how to prove it mathematically
Any comment ? Thanks.
PS: Note that all sums in the above equation runs over positive divisors only.
$\newcommand{\lcm}[0]{\mathrm{lcm}}$Allow me to rewrite this as $$\large \sum_{a \mid \gcd(x, z)} \ \sum_{b \mid \gcd(y,\frac{x z}{a^2})} a b = \sum_{c \mid \gcd(x, y)} \ \sum_{d\ \mid \gcd(z, \frac{x y}{c^2})} c d. $$
I will provide a proof (barring mistakes) in the special case when $\gcd(x, y) = 1$. I have some hope to reduce the general case to this one.
So in this case we have $\lcm(x, y) = x y$, and thus $$ \gcd(z, x y) = \gcd(z, x) \gcd(z, y), $$ where the two factors are coprime. One sees thus that it is enough to prove that $$ \gcd(y, z) = \gcd(y, \frac{x z}{a^{2}}) $$ for each $a \mid \gcd(x, z)$.
Clearly if $t \mid \gcd(y, \dfrac{x z}{a^{2}})$, then $t \mid x z$, and as $t \mid y$, we have $\gcd(t, x) = 1$, so that $t \mid z$. It follows that $t \mid \gcd(y, z)$, or $$ \gcd(y, \frac{x z}{a^{2}}) \mid \gcd(y, z). $$
Conversely, suppose $t \mid \gcd(y, z)$. Since $a \mid x$, we will have $\gcd(t, a) = 1$. Now $$ t \mid x z = a^{2} \cdot \frac{x z}{a^{2}}, $$ and thus $t \mid \dfrac{x z}{a^{2}}$. This shows that $$ \gcd(y, z) \mid \gcd(y, \frac{x z}{a^{2}}). $$