Parking bicycles and cars of many colours Suppose there is a parking space with $N$ lots. A bicycle takes up 1 lot, while a car takes up 2 consecutive lots. There are $a$ colours for bicycles and $b$ colours for cars. How many ways are there to park cars and bicycles in the parking space if the order and colour matter?
For $N=a=b=2$ there are 6 ways; if $N$ is changed to 1 there are 2 ways. See the picture below.


While this problem is quite simple it can nonetheless perhaps serve as
motivation  to  learn more  about  generating  functions.  We have  by
inspection using $z$ for lots, $u$  for bicycles and $v$ for cars that
these are represented by the generating function
$$(1+uz+u^2z^2+\cdots)
\left(\sum_{q\ge 0} (vz^2+v^2z^4+\cdots)^q 
(uz+u^2z^2+\cdots)^q\right)
\\ \times (1+vz^2+v^2z^4+\cdots).$$
This simplifies to
$$\frac{1}{1-uz} 
\left(\sum_{q\ge 0} \frac{(vz^2)^q}{(1-vz^2)^q} 
\frac{(uz)^q}{(1-uz)^q}\right)
\frac{1}{1-vz^2}
\\ = \frac{1}{1-uz} 
\frac{1}{1-uvz^3/(1-vz^2)/(1-uz)}
\frac{1}{1-vz^2}
\\ = \frac{1}{(1-uz)(1-vz^2)-uvz^3}
= \frac{1}{1-uz-vz^2}.$$
Now instantiating  $u$ to  $a$ and  $v$ to $b$  we get  the generating
function
$$\frac{1}{1-az-bz^2}.$$
The  characteristic  equation   of  the  corresponding  recurrence  is
obtained from $1-a/z-b/z^2  = 0$ or $z^2 = az+b.$  Hence the answer is
given  by the recurrence  $f_n= a  f_{n-1} +  b f_{n-2}$  matching the
result that was  obtained by inspection in the  comments, which simply
says that the rightmost occupant is either a bicycle or a car. Initial
values are $f_0=1$ and $f_1=a.$
If we are interested in a closed form we get
$$[z^n] \frac{1}{1-z(a+bz)}.$$
This is $$\sum_{q=0}^n [z^n] z^q (a+bz)^q 
= \sum_{q=0}^n [z^{n-q}] (a+bz)^q 
= \sum_{q=0}^n {q\choose n-q} b^{n-q} a^{2q-n}.$$
