TITLE: What is the maximum value of the LCM of three numbers $\leq n$, as a function of $n$?
QUESTION [5 upvotes]: Given $n \geq 3$, what maximum LCM of any three numbers $\leq n$ can we obtain?
Now, if $n$ is odd, the answer would be
$$n(n - 1)(n - 2)$$
because $\newcommand{\lcm}{\operatorname{lcm}}$
$$\begin{align*}
\lcm(a, b, c) &= \lcm(a, \lcm(b, c))\\\\
&= \lcm\left(a, \frac{bc}{\gcd(b, c)}\right)\\\\
&=\frac{abc}{\gcd(b, c) \gcd(a, \frac{b c}{\gcd(b, c)})}
\end{align*}$$
Now, if $b = a + 1$ and $c = a + 2$ where $a$ is odd, then
$$\gcd(a, c) = \gcd(a, a + 2) = 1$$
Also, we know that $\gcd(a, a + 1) = 1$ for any $a$. We can simplify the
formula as
$$\begin{align*}
\frac{abc}{\gcd(b, c) \gcd(a, \frac{b c}{\gcd(b, c)})} &= \frac{a (a + 1) (a + 2)}{1 \cdot \gcd(a, \frac{b c}{1)})}\\\\
&= \frac{a (a + 1) (a + 2)}{\gcd(a, bc))}
\end{align*}$$
Also since, $a$ and $b$ are coprime and $a$ and $c$ are coprime,
we must have $a$ and $bc$ coprime too, i.e., $\gcd(a, bc) = 1$.
So, the maximum value of LCM for odd $n$ would be
$$n (n - 1)(n - 2)$$
Now, how should I proceed for even $n$?

REPLY [4 votes]: If $n$ is even and $\ge 4$, and not divisible by $3$, use $n(n-1)(n-3)$.
If $n$ is even and divisible by $3$, use $(n-1)(n-2)(n-3)$.