From: Michael Orlitzky Date: Fri, 22 Nov 2019 03:58:13 +0000 (-0500) Subject: mjo-common: add \lcm{} for the least common multiple. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mjotex.git;a=commitdiff_plain;h=774c31185180d9cc4ca487a824ffdf9d6dafe92a mjo-common: add \lcm{} for the least common multiple. --- diff --git a/examples.tex b/examples.tex index 0cf8afa..131a213 100644 --- a/examples.tex +++ b/examples.tex @@ -98,7 +98,9 @@ \end{item} \end{itemize} % - The factorial of the number $10$ is $\factorial{10}$. + The factorial of the number $10$ is $\factorial{10}$, and the + least common multiple of $4$ and $6$ is $\lcm{\set{4,6}} = + 12$. The direct sum of $V$ and $W$ is $\directsum{V}{W}$. Or three things, $\directsumthree{U}{V}{W}$. How about more things? Like diff --git a/mjo-common.tex b/mjo-common.tex index 284d5a5..041a1eb 100644 --- a/mjo-common.tex +++ b/mjo-common.tex @@ -39,6 +39,18 @@ % A seven-tuple of things. \newcommand*{\septuple}[7]{ \left({#1},{#2},{#3},{#4},{#5},{#6},{#7}\right) } +% The "least common multiple of" function. Takes a nonempty set of +% things that can be multiplied and ordered as its argument. Name +% chosen for synergy with \gcd, which *does* exist already. +\newcommand*{\lcm}[1]{ \operatorname{lcm}\of{{#1}} } +\ifdefined\newglossaryentry + \newglossaryentry{lcm}{ + name={\ensuremath{\lcm{X}}}, + description={the least common multiple of the elements of $X$}, + sort=l + } +\fi + % The factorial operator. \newcommand*{\factorial}[1]{ {#1}! }