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 :(
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$