Number Theory – Why LCM of Numbers from 1 to n Approximates e^n

exponential functionleast-common-multiplenumber theory

I computed the LCM for all natural numbers from 1 up to a limit $n$ and plotted the result over $n$. Due to the fast-raising numbers, I plotted the logarithm of the result and was surprised to find a (more or less) identity curve ($x=y$).

In other words, $LCM(1, 2, 3, …, n)$ appears to be roughly the value $e^n$.

Is a there a simple explanation on why this is so?

$LCM(a, b, c, …)$ shall be defined as the least common multiple of all arguments $a, b, c, …$

plot of $ln(LCM(1, 2, 3, …, n))$ over $n$

Best Answer

I think this is basically a different way to state exactly what André Nicolas said in a comment, but observe that the largest power of a given prime $p$ found as a factor in a number less than $n$ is explicitly given by $$ \lfloor\log_p(n)\rfloor=\left\lfloor\frac{\ln n}{\ln p}\right\rfloor $$ so we can write $LCM(n)=LCM(1,2,...,n)$ explicitly as $$ LCM(n)=\prod_{p\leq n}p^{\left\lfloor\frac{\ln n}{\ln p}\right\rfloor} $$ Applying $\ln(x)$ to both sides, we obtain $$ \begin{align} \ln(LCM(n))&=\sum_{p\leq n}\left\lfloor\frac{\ln n}{\ln p}\right\rfloor\cdot\ln p\\ &\approx \sum_{p\leq n}\frac{\ln n}{\ln p}\cdot\ln p\\ &=\ln n\cdot\sum_{p\leq n}1\\ &=\ln n\cdot \pi(n) \end{align} $$ where $\pi(n)$ denotes the function counting primes less than or equal to $n$. Now since by the prime number theorem we have $\pi(n)\sim\frac{n}{\ln n}$ so that these converge asymptotically, we get closer and closer to equality in the following approximation for $\ln(LCM(n))$: $$ \begin{align} \ln(LCM(n))&\approx\ln n\cdot\pi(n)\\ &\approx\ln n\cdot\frac{n}{\ln n}\\ &=n \end{align} $$ Applying the inverse of $\ln(x)$, namely $\text{e}^x$, then shows your statement. Note that the rounding off done by the floor functions becomes asymptotically insignificant.

Related Question