# Average $lcm(a,b)$, $1\le a \le b \le n$, and asymptotic behavior

What is the average value for $\mathrm{lcm}(a,b)$, with $1\le a \le b \le n$, for a
given $n$, and what is the asymptotic behavior? The $\mathrm{lcm}$ is the least common multiple.

I have calculated, as $(n, avg)$:

$$(10, 19.836)$$
$$(100, 1826.859)$$
$$(1000, 182828.976)$$

The values appear to converge quadratically to some constant.

This generalizes to $$\sum_{1 \le j \le k \le n} \mathrm{lcm}(j,k)$$

#### Solutions Collecting From Web of "Average $lcm(a,b)$, $1\le a \le b \le n$, and asymptotic behavior"

Here is a back-of-the-envelope calculation.
Start with the average value of $ab$, which is $(n+1)^2/4$.
Consider powers of $2$ only. Three-quarters of the $(a,b)$ pairs lack $2$ as a common factor. 3/16 have $2^1$ as a common factor, $3/64$ have $4$ as a common factor and so on. So, on average, dealing with powers of $2$ reduces the average by a factor $$\frac341+\frac3{16}\frac12+\frac3{64}\frac14+…\\ =\frac34\left[1+\frac18+\frac1{64}+…\right]\\=\frac{3/4}{7/8}=6/7$$
Consider powers of $3$ only, which will be independent from powers of $2$. The reduction is
$$\frac891+\frac8{81}\frac13+\frac8{729}\frac19+…=\frac{8/9}{26/27}=\frac{12}{13}$$
For any prime $p$, the factor is $\frac{p^3-p}{p^3-1}$, so my final answer is
$$\frac{(n+1)^2}4\prod_{p\,\text{prime}}\frac{p^3-p}{p^3-1}=\frac{(n+1)^2}4\frac{\zeta(3)}{\zeta(2)}$$
That is the Riemann $\zeta$ function, and the constant ratio is
$$\frac{\zeta(3)}{4\zeta(2)}=0.18269074235…$$

Theorem 6.3 of Olivier Bordelles, Mean values of generalized gcd-sum and lcm-sum functions, Journal of Integer Sequences, Vol. 10 (2007), Article 07.9.2, says, for any real number $x$ sufficiently large, $$\sum_{n\le x}\sum_{j=1}^n[n,j]={\zeta(3)\over8\zeta(2)}x^4+O\bigl(x^3(\log x)^{2/3}(\log\log x)^{4/3}\bigr)$$