0
$\begingroup$

I found out that the algorithm for finding LCM of N given numbers by prime factiorization (as on wikipedia) is not always correct. For example: $$ LCM(8, 21) = 2^3*7^1 = 8*7=56 $$ Which is obviously not true. Is there a rule saying that for some numbers this algorithm won't give correct answer? Or something else I'm not aware of?

I'm sorry for my poor english :(

  • 0
    You forgot that $21 = 3\cdot 7$.2017-01-07

1 Answers 1

0

Hint: LCM is not $2^3\times 7$ but it is $2^3\times 3\times 7$.

You can also use the well known fact that LCM*HCF = Product of numbers. HCF of $8, 21$ is $1$. So, $LCM=8*21$

  • 0
    Sarcasm huh... Pleasure @Rohan, you know... Things go worse sometimes2017-01-07
  • 0
    Why what happened?? I am not sarcastic.2017-01-07
  • 0
    wait @Rohan, there are more than one things to say, so I m gonna invite you to a chatroom2017-01-07