20

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$

Alfe
  • 951

1 Answers1

15

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.

String
  • 18,395
  • Not as simple as I hoped for, but I managed. And furthermore I think it won't get much simpler than that. – Alfe Jan 20 '15 at 01:03
  • 7
    We need to consider the error term. Note that \begin{align} \log(\mathrm{lcm}{1,\dots,n})&=\sum_{p\leq n}\left\lfloor \frac{\log n}{\log p}\right\rfloor \log p=\sum_{p\leq n} (\frac{\log n}{\log p}+O(1))\log p\ &=\sum_{p\leq n}\log n+O(\log p)=\pi(n)\log n+O(\sum_{p\leq n}\log n)\ &=\pi(n)\log n+O(\theta (n)), \end{align} where $\theta$ is the first Chebyshev function. Since $\theta(x)\sim x$, the error term is the same size as the main term! – Xiang Yu Apr 13 '16 at 14:33
  • 4
    "Note that the rounding off done by the floor functions becomes asymptotically insignificant." A missing part, if true. – Did Sep 03 '17 at 12:11