Let $a_n$ count the number of ways a sequence of $1$s and $2$s will sum to n.
For example $a_3 = 3$ since $1 + 1 + 1 = 3 = 1 + 2 = 3 = 2 + 1 = 3$
(The ordering matters so 1 + 2 is different from 2 + 1).
Find $a_4$ and $a_5$
I think that
$a_4 = 5$ since $$1 + 1 + 1 + 1 = 2 + 2 = 1 + 1 + 2 = 1 + 2 + 1 = 2 + 1 + 1$$
and $a_5 =8$ since $$1 + 1 + 1 + 1 + 1 = 2 + 2 + 1 = 2 + 1 + 2 = 1 + 2 + 2 = 1 + 1 + 1 + 2 = 1 + 1 + 2 + 1 = 1 + 2 + 1+ 1= 2 + 1 + 1 + 1$$
Now the pattern is emerging, $a_3 + a_4 = a_5$ because $3 + 5 = 8$
Now I want to give a recurrence relation for $a_n$ with initial conditions.
So I would say that $$a_n = a_{n-1} + a_{n-2}$$, It is basically the fibonacci sequence ?
and $a_2 =2$ since $1 + 1 = 2$ and $a_1 = 1$
So the initial conditions is what then ? $a_1 =1$ and $a_2 = 2$ ??