GATE Computer ScienceVery hardGATE CS (PYQ pattern)

How many odd numbers appear in rows 0 to 99 of Pascal's triangle (row n being C(n,0), …, C(n,n))?

  1. A. 1024
  2. B. 1458
  3. C. 2187
  4. D. 1251

Correct answer: D. 1251

By Lucas' theorem row n has 2^(popcount n) odd entries. Rows 0–63 give 3⁶ = 729; rows 64–95 give 2 · 3⁵ = 486; rows 96–99 (binary 11000xx) give 4 · (1 + 2 + 2 + 4) = 36. Total 729 + 486 + 36 = 1251.

More Discrete Mathematics questions

Exams that ask this topic