LCM of consecutive numbers

3.1k Views Asked by At

Given L = LCM(1,2,.....,n) We need to find the largest 'm' such that m<=n and LCM(m,m+1,.....,n) = L

Any process to do so?

eg. LCM (1,2,3,4,5) = 60 and LCM (3,4,5) = 60 So, for n=5 the answer is m=3

1

There are 1 best solutions below

0
On

Let $X_n$ be the set of $p^k$ where $p$ is a prime natural number not greater than $n$ and $k$ is the largest positive integer such that $p^k\leq n$. (Observe that $\text{lcm}(1,2,\ldots,n)=\prod_{q\in X_n}\,q$.) For each $q\in X_n$, let $t_n(q)$ denote the largest multiple of $q$ that is less than or equal to $n$. Take $Y_n$ for the set of $t_n(q)$ for $q\in X_n$. Set $a_n:=\min\left(Y_n\right)$ and $b_n:=\max\left(Y_n\right)$. Then, $$\text{lcm}\left(1,2,\ldots,n\right)=\text{lcm}\left(a_n,a_n+1,\ldots,b_n-1,b_n\right)\,.$$ To answer the OP's question, $m:=a_n$ is the largest such $m$. I also believe that $\left\{a_n,a_n+1,\ldots,b_n-1,b_n\right\}$ is the smallest interval in $\{1,2,\ldots,n\}$ whose lcm is equal to $\text{lcm}(1,2,\ldots,n)$.