Subsets with one consecutive pair

From {1,2,,10}\{1, 2, \dots, 10\}, how many subsets contain exactly one pair of consecutive integers? (For example, {3,5,6,9}\{3,5,6,9\} qualifies - the only consecutive pair is 5,65,6; a subset like {3,4,5}\{3,4,5\} does not, since 3,43,4 and 4,54,5 are two consecutive pairs.)

Show hints (2)+
  1. Think in terms of maximal runs of consecutive chosen integers. "Exactly one consecutive pair" means one run of length 2 and the rest length 1.
  2. Count layouts of one doubleton plus mm singletons along 1..101..10 with gaps between runs, summed over mm.

Answer

Reveal answer →

235

Want the full step-by-step worked solution? It's part of Premium - along with a worked solution for every question in the bank.

Asked at: Jane Street, Two Sigma

Related questions