There are six boxes numbered 1, 2, 3, 4, 5, 6. Each box is to be filled up either with a white ball or a black ball in such a manner that at least one box contains a black ball and all the boxes containing black balls are consecutively numbered. The total number of ways in which this can be done equals:
Show Hint
When elements must be "all consecutive," count non-empty intervals. For \(n\) positions, the number of intervals is \(\frac{n(n+1)}{2}\).
Step 1: Model the condition.
"All black boxes are consecutive" \(\Rightarrow\) the set of black boxes must form a single contiguous block (interval) among the 6 positions.
Step 2: Count all non-empty intervals among 6 positions.
Choose the start and end of the black block: for length \(1\) there are \(6\) choices; for length \(2\), \(5\) choices; \(\dots\); for length \(6\), \(1\) choice.
\[
\text{Total ways} = 6+5+4+3+2+1 = \frac{6\cdot 7}{2} = 21.
\]
\[
\boxed{21}
\]