Fastest way to find LCM and HCF of multiple numbers?












0












$begingroup$


Is there any shortcut approach to find LCM and HCF of multiple numbers apart from prime factorization and hit and trial method (writing down all the multiples of respective numbers and comparing them for finding common multiple)?










share|cite|improve this question











$endgroup$

















    0












    $begingroup$


    Is there any shortcut approach to find LCM and HCF of multiple numbers apart from prime factorization and hit and trial method (writing down all the multiples of respective numbers and comparing them for finding common multiple)?










    share|cite|improve this question











    $endgroup$















      0












      0








      0





      $begingroup$


      Is there any shortcut approach to find LCM and HCF of multiple numbers apart from prime factorization and hit and trial method (writing down all the multiples of respective numbers and comparing them for finding common multiple)?










      share|cite|improve this question











      $endgroup$




      Is there any shortcut approach to find LCM and HCF of multiple numbers apart from prime factorization and hit and trial method (writing down all the multiples of respective numbers and comparing them for finding common multiple)?







      greatest-common-divisor least-common-multiple






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Jan 25 at 14:40









      lioness99a

      3,8612727




      3,8612727










      asked Jan 25 at 14:30









      Yash PanchalYash Panchal

      123




      123






















          1 Answer
          1






          active

          oldest

          votes


















          0












          $begingroup$

          Note that
          $$
          operatorname{HCF}(a, b, c) = operatorname{HCF}(operatorname{HCF}(a, b), c)
          $$

          and similarily for LCM. So using an algorithm which is efficient for two numbers (say, the Euclidean algorithm for HCF, or multiplying them and dividing them by the HCF to get the LCM) will be relatively efficient for more than two numbers as well, just applied repeatedly.





          Example: $a = 6, b = 10$ and $c = 15$. Then their HCF is $1$, and their LCM is $30$ (this is easily confirmed with prime factorisations, for instance). Following my desciption above, we get
          $$
          operatorname{HCF}(6, 10, 15) = operatorname{HCF}(operatorname{HCF}(6, 10), 15)
          $$

          so first we find $operatorname{HCF}(6, 10)$ with the Euclidean algorithm:
          $$
          operatorname{HCF}(6, 10) = operatorname{HCF}(4, 6)\
          = operatorname{HCF}(2, 4) = operatorname{HCF}(0, 2) = 2
          $$

          which then gives
          $$
          operatorname{HCF}(operatorname{HCF}(6, 10), 15) = operatorname{HCF}(2, 15)\
          = operatorname{HCF}(1, 2) = 1
          $$

          As for LCM, we get
          $$
          operatorname{LCM}(6, 10, 15) = operatorname{LCM}(operatorname{LCM}(6, 10), 15)
          $$

          so first we find $operatorname{LCM}(6, 10)$. We know from above that their HCF is $2$, so the LCM is $6cdot 10div 2 = 30$. Thus
          $$
          operatorname{LCM}(operatorname{LCM}(6, 10), 15) = operatorname{LCM}(30, 15)
          $$

          The Euclidean algorithm gives $operatorname{HCF}(30, 15) = 15$, so $operatorname{LCM}(30, 15) = 30cdot 15div 15 = 30$.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            Actually, for LCF you can just use the Euclidean algorithm directly on the triple of numbers: For instance, go from $(6, 10, 15)$ to $(6, 10, 5)$ to $(1, 10, 5)$ and once you see the $1$ there you're done. The advantage of this is that you can be clever with which order you do subtractions, and there is no downside because if you don't immediately spot something obvious and simple, you can just take the first two numbers of the tuple, and you're doing exactly what you would be doing with the pairwise algorithm described above.
            $endgroup$
            – Arthur
            Jan 25 at 15:02












          • $begingroup$
            I was about to suggest thst! And once you see $6$ with $5$ you know there's no common factor but $1$.
            $endgroup$
            – timtfj
            Jan 25 at 15:05











          Your Answer





          StackExchange.ifUsing("editor", function () {
          return StackExchange.using("mathjaxEditing", function () {
          StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
          StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
          });
          });
          }, "mathjax-editing");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "69"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3087151%2ffastest-way-to-find-lcm-and-hcf-of-multiple-numbers%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0












          $begingroup$

          Note that
          $$
          operatorname{HCF}(a, b, c) = operatorname{HCF}(operatorname{HCF}(a, b), c)
          $$

          and similarily for LCM. So using an algorithm which is efficient for two numbers (say, the Euclidean algorithm for HCF, or multiplying them and dividing them by the HCF to get the LCM) will be relatively efficient for more than two numbers as well, just applied repeatedly.





          Example: $a = 6, b = 10$ and $c = 15$. Then their HCF is $1$, and their LCM is $30$ (this is easily confirmed with prime factorisations, for instance). Following my desciption above, we get
          $$
          operatorname{HCF}(6, 10, 15) = operatorname{HCF}(operatorname{HCF}(6, 10), 15)
          $$

          so first we find $operatorname{HCF}(6, 10)$ with the Euclidean algorithm:
          $$
          operatorname{HCF}(6, 10) = operatorname{HCF}(4, 6)\
          = operatorname{HCF}(2, 4) = operatorname{HCF}(0, 2) = 2
          $$

          which then gives
          $$
          operatorname{HCF}(operatorname{HCF}(6, 10), 15) = operatorname{HCF}(2, 15)\
          = operatorname{HCF}(1, 2) = 1
          $$

          As for LCM, we get
          $$
          operatorname{LCM}(6, 10, 15) = operatorname{LCM}(operatorname{LCM}(6, 10), 15)
          $$

          so first we find $operatorname{LCM}(6, 10)$. We know from above that their HCF is $2$, so the LCM is $6cdot 10div 2 = 30$. Thus
          $$
          operatorname{LCM}(operatorname{LCM}(6, 10), 15) = operatorname{LCM}(30, 15)
          $$

          The Euclidean algorithm gives $operatorname{HCF}(30, 15) = 15$, so $operatorname{LCM}(30, 15) = 30cdot 15div 15 = 30$.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            Actually, for LCF you can just use the Euclidean algorithm directly on the triple of numbers: For instance, go from $(6, 10, 15)$ to $(6, 10, 5)$ to $(1, 10, 5)$ and once you see the $1$ there you're done. The advantage of this is that you can be clever with which order you do subtractions, and there is no downside because if you don't immediately spot something obvious and simple, you can just take the first two numbers of the tuple, and you're doing exactly what you would be doing with the pairwise algorithm described above.
            $endgroup$
            – Arthur
            Jan 25 at 15:02












          • $begingroup$
            I was about to suggest thst! And once you see $6$ with $5$ you know there's no common factor but $1$.
            $endgroup$
            – timtfj
            Jan 25 at 15:05
















          0












          $begingroup$

          Note that
          $$
          operatorname{HCF}(a, b, c) = operatorname{HCF}(operatorname{HCF}(a, b), c)
          $$

          and similarily for LCM. So using an algorithm which is efficient for two numbers (say, the Euclidean algorithm for HCF, or multiplying them and dividing them by the HCF to get the LCM) will be relatively efficient for more than two numbers as well, just applied repeatedly.





          Example: $a = 6, b = 10$ and $c = 15$. Then their HCF is $1$, and their LCM is $30$ (this is easily confirmed with prime factorisations, for instance). Following my desciption above, we get
          $$
          operatorname{HCF}(6, 10, 15) = operatorname{HCF}(operatorname{HCF}(6, 10), 15)
          $$

          so first we find $operatorname{HCF}(6, 10)$ with the Euclidean algorithm:
          $$
          operatorname{HCF}(6, 10) = operatorname{HCF}(4, 6)\
          = operatorname{HCF}(2, 4) = operatorname{HCF}(0, 2) = 2
          $$

          which then gives
          $$
          operatorname{HCF}(operatorname{HCF}(6, 10), 15) = operatorname{HCF}(2, 15)\
          = operatorname{HCF}(1, 2) = 1
          $$

          As for LCM, we get
          $$
          operatorname{LCM}(6, 10, 15) = operatorname{LCM}(operatorname{LCM}(6, 10), 15)
          $$

          so first we find $operatorname{LCM}(6, 10)$. We know from above that their HCF is $2$, so the LCM is $6cdot 10div 2 = 30$. Thus
          $$
          operatorname{LCM}(operatorname{LCM}(6, 10), 15) = operatorname{LCM}(30, 15)
          $$

          The Euclidean algorithm gives $operatorname{HCF}(30, 15) = 15$, so $operatorname{LCM}(30, 15) = 30cdot 15div 15 = 30$.






          share|cite|improve this answer











          $endgroup$













          • $begingroup$
            Actually, for LCF you can just use the Euclidean algorithm directly on the triple of numbers: For instance, go from $(6, 10, 15)$ to $(6, 10, 5)$ to $(1, 10, 5)$ and once you see the $1$ there you're done. The advantage of this is that you can be clever with which order you do subtractions, and there is no downside because if you don't immediately spot something obvious and simple, you can just take the first two numbers of the tuple, and you're doing exactly what you would be doing with the pairwise algorithm described above.
            $endgroup$
            – Arthur
            Jan 25 at 15:02












          • $begingroup$
            I was about to suggest thst! And once you see $6$ with $5$ you know there's no common factor but $1$.
            $endgroup$
            – timtfj
            Jan 25 at 15:05














          0












          0








          0





          $begingroup$

          Note that
          $$
          operatorname{HCF}(a, b, c) = operatorname{HCF}(operatorname{HCF}(a, b), c)
          $$

          and similarily for LCM. So using an algorithm which is efficient for two numbers (say, the Euclidean algorithm for HCF, or multiplying them and dividing them by the HCF to get the LCM) will be relatively efficient for more than two numbers as well, just applied repeatedly.





          Example: $a = 6, b = 10$ and $c = 15$. Then their HCF is $1$, and their LCM is $30$ (this is easily confirmed with prime factorisations, for instance). Following my desciption above, we get
          $$
          operatorname{HCF}(6, 10, 15) = operatorname{HCF}(operatorname{HCF}(6, 10), 15)
          $$

          so first we find $operatorname{HCF}(6, 10)$ with the Euclidean algorithm:
          $$
          operatorname{HCF}(6, 10) = operatorname{HCF}(4, 6)\
          = operatorname{HCF}(2, 4) = operatorname{HCF}(0, 2) = 2
          $$

          which then gives
          $$
          operatorname{HCF}(operatorname{HCF}(6, 10), 15) = operatorname{HCF}(2, 15)\
          = operatorname{HCF}(1, 2) = 1
          $$

          As for LCM, we get
          $$
          operatorname{LCM}(6, 10, 15) = operatorname{LCM}(operatorname{LCM}(6, 10), 15)
          $$

          so first we find $operatorname{LCM}(6, 10)$. We know from above that their HCF is $2$, so the LCM is $6cdot 10div 2 = 30$. Thus
          $$
          operatorname{LCM}(operatorname{LCM}(6, 10), 15) = operatorname{LCM}(30, 15)
          $$

          The Euclidean algorithm gives $operatorname{HCF}(30, 15) = 15$, so $operatorname{LCM}(30, 15) = 30cdot 15div 15 = 30$.






          share|cite|improve this answer











          $endgroup$



          Note that
          $$
          operatorname{HCF}(a, b, c) = operatorname{HCF}(operatorname{HCF}(a, b), c)
          $$

          and similarily for LCM. So using an algorithm which is efficient for two numbers (say, the Euclidean algorithm for HCF, or multiplying them and dividing them by the HCF to get the LCM) will be relatively efficient for more than two numbers as well, just applied repeatedly.





          Example: $a = 6, b = 10$ and $c = 15$. Then their HCF is $1$, and their LCM is $30$ (this is easily confirmed with prime factorisations, for instance). Following my desciption above, we get
          $$
          operatorname{HCF}(6, 10, 15) = operatorname{HCF}(operatorname{HCF}(6, 10), 15)
          $$

          so first we find $operatorname{HCF}(6, 10)$ with the Euclidean algorithm:
          $$
          operatorname{HCF}(6, 10) = operatorname{HCF}(4, 6)\
          = operatorname{HCF}(2, 4) = operatorname{HCF}(0, 2) = 2
          $$

          which then gives
          $$
          operatorname{HCF}(operatorname{HCF}(6, 10), 15) = operatorname{HCF}(2, 15)\
          = operatorname{HCF}(1, 2) = 1
          $$

          As for LCM, we get
          $$
          operatorname{LCM}(6, 10, 15) = operatorname{LCM}(operatorname{LCM}(6, 10), 15)
          $$

          so first we find $operatorname{LCM}(6, 10)$. We know from above that their HCF is $2$, so the LCM is $6cdot 10div 2 = 30$. Thus
          $$
          operatorname{LCM}(operatorname{LCM}(6, 10), 15) = operatorname{LCM}(30, 15)
          $$

          The Euclidean algorithm gives $operatorname{HCF}(30, 15) = 15$, so $operatorname{LCM}(30, 15) = 30cdot 15div 15 = 30$.







          share|cite|improve this answer














          share|cite|improve this answer



          share|cite|improve this answer








          edited Jan 25 at 14:52

























          answered Jan 25 at 14:46









          ArthurArthur

          118k7118202




          118k7118202












          • $begingroup$
            Actually, for LCF you can just use the Euclidean algorithm directly on the triple of numbers: For instance, go from $(6, 10, 15)$ to $(6, 10, 5)$ to $(1, 10, 5)$ and once you see the $1$ there you're done. The advantage of this is that you can be clever with which order you do subtractions, and there is no downside because if you don't immediately spot something obvious and simple, you can just take the first two numbers of the tuple, and you're doing exactly what you would be doing with the pairwise algorithm described above.
            $endgroup$
            – Arthur
            Jan 25 at 15:02












          • $begingroup$
            I was about to suggest thst! And once you see $6$ with $5$ you know there's no common factor but $1$.
            $endgroup$
            – timtfj
            Jan 25 at 15:05


















          • $begingroup$
            Actually, for LCF you can just use the Euclidean algorithm directly on the triple of numbers: For instance, go from $(6, 10, 15)$ to $(6, 10, 5)$ to $(1, 10, 5)$ and once you see the $1$ there you're done. The advantage of this is that you can be clever with which order you do subtractions, and there is no downside because if you don't immediately spot something obvious and simple, you can just take the first two numbers of the tuple, and you're doing exactly what you would be doing with the pairwise algorithm described above.
            $endgroup$
            – Arthur
            Jan 25 at 15:02












          • $begingroup$
            I was about to suggest thst! And once you see $6$ with $5$ you know there's no common factor but $1$.
            $endgroup$
            – timtfj
            Jan 25 at 15:05
















          $begingroup$
          Actually, for LCF you can just use the Euclidean algorithm directly on the triple of numbers: For instance, go from $(6, 10, 15)$ to $(6, 10, 5)$ to $(1, 10, 5)$ and once you see the $1$ there you're done. The advantage of this is that you can be clever with which order you do subtractions, and there is no downside because if you don't immediately spot something obvious and simple, you can just take the first two numbers of the tuple, and you're doing exactly what you would be doing with the pairwise algorithm described above.
          $endgroup$
          – Arthur
          Jan 25 at 15:02






          $begingroup$
          Actually, for LCF you can just use the Euclidean algorithm directly on the triple of numbers: For instance, go from $(6, 10, 15)$ to $(6, 10, 5)$ to $(1, 10, 5)$ and once you see the $1$ there you're done. The advantage of this is that you can be clever with which order you do subtractions, and there is no downside because if you don't immediately spot something obvious and simple, you can just take the first two numbers of the tuple, and you're doing exactly what you would be doing with the pairwise algorithm described above.
          $endgroup$
          – Arthur
          Jan 25 at 15:02














          $begingroup$
          I was about to suggest thst! And once you see $6$ with $5$ you know there's no common factor but $1$.
          $endgroup$
          – timtfj
          Jan 25 at 15:05




          $begingroup$
          I was about to suggest thst! And once you see $6$ with $5$ you know there's no common factor but $1$.
          $endgroup$
          – timtfj
          Jan 25 at 15:05


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Mathematics Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          Use MathJax to format equations. MathJax reference.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3087151%2ffastest-way-to-find-lcm-and-hcf-of-multiple-numbers%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          'app-layout' is not a known element: how to share Component with different Modules

          android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

          WPF add header to Image with URL pettitions [duplicate]