GATE Computer ScienceModerateGATE CS (PYQ pattern)

In how many ways can 30 be written as a sum of ODD positive integers, where order does not matter and parts may repeat?

  1. A. 296
  2. B. 5604
  3. C. 280
  4. D. 312

Correct answer: A. 296

By Euler's partition theorem, partitions into odd parts are equinumerous with partitions into distinct parts, and the number of partitions of 30 into distinct parts is 296 (a direct DP over odd parts 1, 3, …, 29 gives the same). 5604 is the number of all partitions of 30.

More Algorithms questions

Exams that ask this topic