LCMSteps - Maple Help

Student[Basics]

 LCMSteps
 generate steps for calculating the Least Common Multiple

 Calling Sequence LCMSteps( expr ) LCMSteps( expr, implicitmultiply = true )

Parameters

 expr - list of integers or strings, sequence of integers, or an expression that contains %lcm(...) implicitmultiply - (optional) truefalse output = ... - (optional) option to control the return value displaystyle = ... - (optional) option to control the layout of the steps

Description

 • The LCMSteps command accepts a list or sequence of integers, or an expression that contains %lcm, and gives steps for calculating the Least Common Multiple (or Lowest Common Multiple). It calculates these steps by prime factorization.
 • When expr is a list, one or more elements of the list can be given as a string. In this case, the string is parsed into an expression using InertForm:-Parse so that no automatic simplifications are applied, and thus no steps are missed.
 • The implicitmultiply option is only relevant when expr is a list of strings.  This option is passed directly on to the InertForm:-Parse command and will cause things like 2x to be interpreted as 2*x, but also, xyz to be interpreted as x*y*z.
 • The output and displaystyle options are described in Student:-Basics:-OutputStepsRecord. The return value is controlled by the output option.
 • This function is part of the Student:-Basics package.

Examples

 > $\mathrm{with}\left(\mathrm{Student}:-\mathrm{Basics}\right):$
 > $\mathrm{LCMSteps}\left(\left[12,3,4\right]\right)$
 $\begin{array}{lll}{}& {}& {\mathrm{lcm}}{}\left({12}{,}{3}{,}{4}\right)\\ \text{•}& {}& \text{Prime factorize each term:}\\ {}& {}& \left[\begin{array}{c}{12}{=}{\left({2}\right)}^{{2}}{}\left({3}\right)\\ {3}{=}\left({3}\right)\\ {4}{=}{\left({2}\right)}^{{2}}\end{array}\right]\\ \text{•}& {}& \text{Take each factor of the highest power and multiply}\\ {}& {}& {\left({2}\right)}^{{2}}{}\left({3}\right)\\ \text{•}& {}& \text{Simplify}\\ {}& {}& {12}\end{array}$ (1)
 > $\mathrm{LCMSteps}\left(4,5,6\right)$
 $\begin{array}{lll}{}& {}& {\mathrm{lcm}}{}\left({4}{,}{5}{,}{6}\right)\\ \text{•}& {}& \text{Prime factorize each term:}\\ {}& {}& \left[\begin{array}{c}{4}{=}{\left({2}\right)}^{{2}}\\ {5}{=}\left({5}\right)\\ {6}{=}\left({2}\right){}\left({3}\right)\end{array}\right]\\ \text{•}& {}& \text{Take each factor of the highest power and multiply}\\ {}& {}& {\left({2}\right)}^{{2}}{}\left({3}\right){}\left({5}\right)\\ \text{•}& {}& \text{Simplify}\\ {}& {}& {60}\end{array}$ (2)
 > $\mathrm{LCMSteps}\left("lcm\left(6, 8\right) + lcm\left(4, 5\right) - 5"\right)$
 $\begin{array}{lll}{}& {}& {\mathrm{lcm}}{}\left({6}{,}{8}\right){+}{\mathrm{lcm}}{}\left({4}{,}{5}\right){-}{5}\\ \text{•}& {}& \text{Exmaine term}\\ {}& {}& {\mathrm{lcm}}{}\left({6}{,}{8}\right)\\ \text{•}& {}& \text{Prime factorize each term:}\\ {}& {}& \left[\begin{array}{c}{6}{=}\left({2}\right){}\left({3}\right)\\ {8}{=}{\left({2}\right)}^{{3}}\end{array}\right]\\ \text{•}& {}& \text{Take each factor of the highest power and multiply}\\ {}& {}& {\left({2}\right)}^{{3}}{}\left({3}\right)\\ \text{•}& {}& \text{Simplify}\\ {}& {}& {24}\\ \text{•}& {}& \text{This gives:}\\ {}& {}& {24}{+}{\mathrm{lcm}}{}\left({4}{,}{5}\right){-}{5}\\ \text{•}& {}& \text{Exmaine term}\\ {}& {}& {\mathrm{lcm}}{}\left({4}{,}{5}\right)\\ \text{•}& {}& \text{Prime factorize each term:}\\ {}& {}& \left[\begin{array}{c}{4}{=}{\left({2}\right)}^{{2}}\\ {5}{=}\left({5}\right)\end{array}\right]\\ \text{•}& {}& \text{Take each factor of the highest power and multiply}\\ {}& {}& {\left({2}\right)}^{{2}}{}\left({5}\right)\\ \text{•}& {}& \text{Simplify}\\ {}& {}& {20}\\ \text{•}& {}& \text{This gives:}\\ {}& {}& {24}{+}{20}{-}{5}\\ \text{•}& {}& \text{Simplify}\\ {}& {}& {39}\end{array}$ (3)

Compatibility

 • The Student:-Basics:-LCMSteps command was introduced in Maple 2024.