f(14) needs to be found.
f(14)=No of sequences having digit 2 repeated x times and digit 1 repeated y times.
To get a sum of 14 y needs to be an even number.
So,
14=2*x+1*2n
=>14=2(x+n)
so x+n=7
The possible values for x and n are
x ----- n
1 6
2 5
3 4
4 3
5 2
6 1
7 0
Consider the case where x=1 and n=6 ----> has digit 2 repeated once and digit 1 repeated twelve times(n=6)
Note: The number of ways of arranging a identical and b identical things together to contain a+b things are (a+b)! / ((a!)*(b!))
In the considered case a=1 and b=12 ; No of ways of arranging 1 identical thing and 12 identical things are (13!)/(12!)*(1!)=13
In Similar Lines.....
x ----- n ------- No of arrangements
1 6 13
2 5 66
3 4 165
4 3 210
5 2 126
6 1 28
7 0 1
------------------
Total 609
----------------
No of Sequences of 1's and 2's sum to 14 are 609.
Regards
Praneeth