Use two consecutive Leonardo (da Pisa, called Fibonacci) recursion equations
\begin{align}
F_{n+2}&=F_{n+1}+F_{n}\\
F_{n-1}&=F_{n+1}-F_n
\end{align}
square them and add them
\begin{align}
F_{n+2}^2&=F_{n+1}^2+F_{n}^2+2F_{n+1}F_{n}\\
F_{n-1}^2&=F_{n+1}^2+F_n^2-2F_{n+1}F_n\\[0.3em]\hline
F_{n+2}^2+F_{n-1}^2&=2F_{n+1}^2+2F_n^2
\end{align}
Now find the generating function for this recursion formula.
I've been reading some papers recently on higher-order Fibonacci Numbers (aka "n-bonacci"),
and I found to be common practice to define them by the recurrence
$$
F_{\,n} ^{\left( m \right)} = \sum\limits_{k = 1}^m {F_{\,n - k} ^{\left( m \right)} }
$$
so that there is common agreement on that $m=2$ be the standard Fibonacci,
and assigning as initial values the $m$-tuple
$$
\left( {\underbrace {0,0, \cdots ,0}_{m - 1\;{\rm zeros}},1} \right)
$$
The only difference I found is that the $m$-tuple
- by some sources (e.g 1) is made to start at the index $0$
$$
F_{\,0} ^{\left( m \right)} = F_{\,1} ^{\left( m \right)} = \cdots = F_{\,m - 2} ^{\left( m \right)} = 0,\quad F_{\,m - 1} ^{\left( m \right)} = 1
$$
- others (e.g. 2) prefer to fix the one at $n=1$ and so put
$$
F_{\, - m + 2} ^{\left( m \right)} = F_{ - m + 3} ^{\left( m \right)} = \cdots = F_{\,0} ^{\left( m \right)} = 0,\quad F_{\,1} ^{\left( m \right)} = 1
$$
The difference is just a shift in the lower index.
I personally prefer the second setting since it provides a simpler extension of the o.g.f.
$$
\eqalign{
& G\left( {z,2} \right) = {z \over {1 - z - z^{\,2} }} = {z \over {1 - z\left( {1 + z} \right)}} = {z \over {1 - z{{1 - z^{\,2} } \over {1 - z}}}}\quad \Rightarrow \cr
& \Rightarrow \quad G\left( {z,m} \right) = {z \over {1 - z\left( {1 + z + \cdots + z^{\,m - 1} } \right)}} = {z \over {1 - z{{1 - z^{\,m} } \over {1 - z}}}} \cr}
$$
Best Answer
The coefficient of $x^k$ in $(x+x^2)^n$ gives the number of ways to reach a total of $k$ with $n$ terms, each of which is $1$ or $2$, so the coefficient of $x^k$ in $\sum_{n\ge 0}(x+x^2)^n$ gives the number of ways to reach a total of $k$ with any number of terms, each of which is $1$ or $2$. But formally $$\sum_{n\ge 0}(x+x^2)^n = \frac{1}{1-(x+x^2)} = \frac{1}{1-x-x^2},$$ which is your generating function.