TITLE: How many ways can $133$ be written as sum of only $1s$ and $2s$
QUESTION [11 upvotes]: Since last week I have been working on a way, how to sum $1$ and $2$ to have $133$.
So for instance we can have $133$ $1s$ or $61$ $s$2 and one and so on. Looking back to the example: if we sum: $1 + 1... + 1 = 133$ there is only one way. But for the second one there will be $131$ possible ways. And I have to do this for every possible combination. I am stuck with it and I have no idea whatsoever on how to begin.
Any ideas or methods I could use guys?

REPLY [5 votes]: This is essentially an explanation of Jack D'Aurizio's answer.
Let $k$ be the number of twos, then we have $n-2k$ ones. There are then
$$
\sum_{k=0}^{\lfloor n/2\rfloor}\binom{n-k}{k}=\sum_{k=0}^\infty\binom{n-k}{n-2k}
$$
ways to write $n$ as a sum of ones and twos. One way to compute this number is to look at the generating function.
$$
\begin{align}
\sum_{n=0}^\infty\sum_{k=0}^\infty\binom{n-k}{n-2k}x^n
&=\sum_{k=0}^\infty x^{2k}\sum_{n=0}^\infty\binom{-k-1}{n-2k}(-x)^{n-2k}\\
&=\sum_{k=0}^\infty\frac{x^{2k}}{(1-x)^{k+1}}\\
&=\frac1{1-x}\frac1{1-\frac{x^2}{1-x}}\\
&=\frac1{1-x-x^2}
\end{align}
$$
Which is the generating function for $F_{n+1}$, the Fibonacci numbers offset by $1$. Setting $n=133$, we get
$$
F_{134}=4517090495650391871408712937
$$