Unsure about the relationships created by $LCM(1, 2,..., n)$

209 Views Asked by At

today I was investigating least common multiples up to some integer $n$. I made a simple program to create a graph of $\frac{LCM(1, 2,..., n)}{n}$ and noticed a resemblence to a $\frac{1}{n}$ graph, though it's quite chaotic.

very chaotic

I then changed the function to $\sum_{1}^n\left(\frac{LCM(1, 2,..., n)}{n}\right)$, which came out much smoother as it is cumulative, however the scale is way off (in the billions), and I couldn't find a base that produced a linear relationship, so I was unsure if it was logarithmic.

much accumulate

Something I found quite interesting was when plotting $\frac{LCM(1, 2,..., n)}{LCM(1, 2,..., (n-1))}$, all of the peaks (integer values in the line y = x) were either primes or very close to primes (usually ±1, the max I found was a difference of 3).

so primes

My question is why these relationships emerge - are they linked to the primes (like the PNT)?

Thanks!

EDIT: Graph of $\frac{log\left(LCM(1, 2,..., n)\right)}{n}$ by request: many log

3

There are 3 best solutions below

1
On

There is something strange about your graphs. Namely, $LCM(1, \dotsc, n)$ is no smaller than the product of all primes between $2$ and $n,$ which, the prime number theorem tells us, behaves like $e^n.$ Now, because of higher powers of primes, the LCM behaves roughly like $e^n e^{n^{(1/2)}} e^{n^{(1/3)}} \dots \ll \exp((2+ \epsilon) n),$ for any $\epsilon.$ So, what ARE the graphs of? If, as suggested by Aaron you are dividing by $n!,$ that make slightly more sense, but then the decay should be much faster than $1/n$

3
On

When you plot $\frac{LCM(1, 2,..., n)}{LCM(1, 2,..., (n-1))}$ you should always get $1$ unless $n$ is prime, in which case the ratio should be $n$, or $n$ is the power of a prime, when the ratio should be that prime. In all other cases you can decompose $n$ into coprime factors less than $n$. Those factors will already be included in $LCM(1, 2,..., (n-1))$. Your plot cannot be correct as it is missing peaks at many primes.

0
On

As Ross pointed out, your LCM increases only when $n$ is a prime or prime power, so I printed out only those $n.$ Note how similar the logarithm is to $n$ itself. The "natural log of lcm" is Chebyshev's second function applied to this $n,$ in symbols $\psi(n).$ The Prime Number Theorem is that $\psi(n) \approx n,$ and the limit of their ratio is $1$ as $n$ increases without bound.

 n 2 =  2    natural log of LCM  0.693147   lcm  2
 n 3 =  3    natural log of LCM  1.79176   lcm  6
 n 4 =  2^2    natural log of LCM  2.48491   lcm  12
 n 5 =  5    natural log of LCM  4.09434   lcm  60
 n 7 =  7    natural log of LCM  6.04025   lcm  420
 n 8 =  2^3    natural log of LCM  6.7334   lcm  840
 n 9 =  3^2    natural log of LCM  7.83201   lcm  2520
 n 11 =  11    natural log of LCM  10.2299   lcm  27720
 n 13 =  13    natural log of LCM  12.7949   lcm  360360
 n 16 =  2^4    natural log of LCM  13.488   lcm  720720
 n 17 =  17    natural log of LCM  16.3212   lcm  12252240
 n 19 =  19    natural log of LCM  19.2657   lcm  232792560
 n 23 =  23    natural log of LCM  22.4012   lcm  5354228880
 n 25 =  5^2    natural log of LCM  24.0106   lcm  26771144400
 n 27 =  3^3    natural log of LCM  25.1092   lcm  80313433200
 n 29 =  29    natural log of LCM  28.4765   lcm  2329089562800
 n 31 =  31    natural log of LCM  31.9105   lcm  72201776446800
 n 32 =  2^5    natural log of LCM  32.6036   lcm  144403552893600
 n 37 =  37    natural log of LCM  36.2146   lcm  5342931457063200
 n 41 =  41    natural log of LCM  39.9281   lcm  219060189739591200
 n 43 =  43    natural log of LCM  43.6893   lcm  9419588158802421600
 n 47 =  47    natural log of LCM  47.5395   lcm  442720643463713815200
 n 49 =  7^2    natural log of LCM  49.4854   lcm  3099044504245996706400
 n 53 =  53    natural log of LCM  53.4557   lcm  164249358725037825439200
 n 59 =  59    natural log of LCM  57.5332   lcm  9690712164777231700912800
 n 61 =  61    natural log of LCM  61.6441   lcm  591133442051411133755680800
 n 64 =  2^6    natural log of LCM  62.3372   lcm  1182266884102822267511361600
 n 67 =  67    natural log of LCM  66.5419   lcm  79211881234889091923261227200
 n 71 =  71    natural log of LCM  70.8046   lcm  5624043567677125526551547131200
 n 73 =  73    natural log of LCM  75.0951   lcm  410555180440430163438262940577600
 n 79 =  79    natural log of LCM  79.4645   lcm  32433859254793982911622772305630400
 n 81 =  3^4    natural log of LCM  80.5631   lcm  97301577764381948734868316916891200
 n 83 =  83    natural log of LCM  84.982   lcm  8076030954443701744994070304101969600
 n 89 =  89    natural log of LCM  89.4706   lcm  718766754945489455304472257065075294400
 n 97 =  97    natural log of LCM  94.0453   lcm  69720375229712477164533808935312303556800

=================================================