It can be shown by induction on n≥0 that f(n,k)=0 if k<0 or n2+n+1<k, f(n,n2+n+1−k)=f(n,k) for all k, and ∑k=0n2+n+1f(n,k)=2n+1. For example,
the induction step for the second claim can be verified as follows:
f(n+1,(n+1)2+(n+1)+1−k)=f(n,(n+1)2+(n+1)+1−k)+f(n,(n+1)2+(n+1)+1−k−2(n+1))=f(n,n2+n+1−(k−2(n+1)))+f(n,n2+n+1−k)=f(n,k−2(n+1))+f(n,k)=f(n+1,k)
Therefore,
k=0∑(2(2009))f(2008,k)=21k=0∑20082+2008+1f(2008,k)=2122009=22008.