GATE Computer ScienceVery hardGATE CSE · UGC NET

In how many different ORDERED sequences of coins from {1, 4, 5} can a total of exactly 15 be formed (sequences like 1,4 and 4,1 count separately)?

  1. A. 10
  2. B. 249
  3. C. 191
  4. D. 200

Correct answer: D. 200

With f(s) = f(s−1)+f(s−4)+f(s−5), f(15) = 200; the unordered count would be only 10.

More Algorithms questions

Exams that ask this topic