For $n \geq 1$, let $B(n)$ be the number of ways to express $n$ as the sum of $1$s and $2$s, taking order into account. Thus $B(4) = 5$ because $4 = 1 + 1 + 1 + 1 = 1 + 1 + 2 = 1 + 2 + 1 = 2 + 1 + 1 = 2 + 2$.
(a) Compute $B(i)$ for $1 \leq i \leq 5$ by showing all the different ways to write these numbers as above.
(b) Find a recursive definition for $B(n)$ and identify this sequence.
(c) Compute $B(10)$.
I've done part (a)
$B(1) = 1$ because $1 = (1)$
$B(2) = 2$ because $2 = (1+1) = (2)$
$B(3) = 3$ because $3 = (1+1+1) = (1+2) = (2+1)$
$B(4) = 5$ because $4 = (1 + 1 + 1 + 1) = (1 + 1 + 2) = (1 + 2 + 1) = (2 + 1 + 1) = (2 + 2)$
$B(5) = 8$ because $$5 = (1+1+1+1+1) = (1+1+1+2) = (1+1+2+1) = (1+2+1+1)\\ = (2+1+1+1) = (1+2+2) = (2+1+2) = (2+2+1)$$
*Note I used parenthesis for clarity
How would I do part B?
Hint: There are two questions for you to answer. Suppose that $n\ge 3.$ How many ways are there to obtain $n$ as such a sum where the first number is $1$? What if the first number is $2$? What can you then conclude?