Data Structures & AlgorithmsHardGATE CS · Codeforces Div2 B

What is the sum of lcm(i, i+1) for i = 1 to 9?

  1. A. 331
  2. B. 332
  3. C. 330
  4. D. 334

Correct answer: C. 330

Consecutive integers are coprime, so lcm(i, i+1) = i(i+1). The sum of i(i+1) over i = 1..9 is 330.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic