How many ways can 1's and 2's be added to equal 17 if order matters? Question is in full in the title. I didn't think I'd be back here so quickly since most of these permutation and combination exercises aren't very difficult, but this is the second one that has me scratching my head on where to even begin. I've done some Googling for help, but I haven't found anything similar enough to this problem to help me out.
 A: Hint: Let $f(k)$ be the number of ways to generate a sum of $k$. Next, suppose you are trying to compute $f(n)$. How many of those combinations end with a $1$? How many end with a $2$? Add these two up to get $f(n)$. Use a recurrence relation. Look familiar? Compute $f(17)$.
A: Let $f(n)$ be the number of ways of adding $1$s and $2$s to get $n$.
$f(0) = 0$
$f(1) = 1$
As we can summing upto $n-1$ and adding $1$ or summing upto $n-2$ and adding $2$, we get,
$f(n) = f(n-1) + f(n-2)$
for $n>1$
This is the definition of the Fibonacci number sequence, which is the solution.
A: I had exactly this pop up in a real-life[1] problem I was solving just yesterday. Here's a Hint:
Start small: try making sums of 1's and 2's that add up to 1, 2, 3, 4, 5, 6. By this time you should see the pattern, which is a sequence of numbers you should recognize. Proving that the numbers actually follow this sequence is not particularly difficult. Then, find the 17th number in the sequence (also not difficult).
[1] Well, sort of real-life. It has to do with sums that arise in a covariance matrix in an autoregressive model in statistics. The number of terms in each sum is given by this problem.
A: Denote by a number of 2-s and b number of 1-s then number of permutations(arrangements) of $a+b$ objects where are $a$ of first kind and $b$ of second kind is $$\frac{(a+b)!}{a!b!}$$ 
if $$a\cdot 2+b\cdot 1=17\Rightarrow b=17-2a,0\leq a\leq 8,a+b=17-a$$
$$\sum_{2a+b=17}\frac{(a+b)!}{a!b!}=\sum_{a=0}^{8}\frac{(17-a)!}{a!(17-2a)!}=\sum_{a=0}^{8}\binom{17-a}{a}=F_{18}=1597$$
A: If you have some programming skills, you could find the answer computationally, Project Euler-style.  Simply write a program that iterates over all of the possible combinations of terms, and count the number of combinations that add up to seventeen.
We know that there are at  most seventeen terms (1 + 1 + 1 ... = 17), and three possible values for each term (0, 1, or 2).  So we can give an upper bound on the number of iterations as 3^17 = 129140163, which is a manageable number of iterations.
Clearly this solution is no good for sums much bigger than 17, as the number of iterations required grows exponentially.
Given the more elegant mathematical answers I've seen here, this is probably akin to swatting a fly with a sledgehammer, but it is a solution nonetheless :)
I just noticed this is tagged homework, so I'm pulling the code I posted, to respect that.  You can still find it in the edit history if you really want to see it.  Instead, here are some hints:


*

*The hardest part will probably be finding a way to iterate over the possible combinations.  It might help to think of the terms as digits in a trinary (base-3) number that you increment from 0 to 11111111111111111.

*Be careful of combinations that are actually the same - ...121 and ...1210, for example

*Whenever you find a combination that adds to 17, add it to a Set.  The answer will be the size of the Set once you finish iterating.

