Question about the indices in double Sum

Posted 10 years ago
2824 Views
|
2 Replies
|
0 Total Likes
|
 Hi, i would like to create a function , or a sum that is bivariate and the sum of two variables give me a specific number.For example, lets say I have a function f[x,y], where x,y integers and >0.I need to create a function, lets say it G[z_], where if z==0  then G[0] = f[0,0]    if z==1 then G[1]= f[1,0] + f[0,1]if z==2 then G[2]= f[2,0]+f[0,2]+f[1,1]...if z==k then G[k]= f[k,0]+ f[k-1,1]+f[k-2,2]+......+f[2,k-2]+f[1,k-1]+f[0,k]I was trying to make a  double sum like      Sum[f[i,j],{i,0,k},{j,0,k}]apparently this is not correct, but that would be a convinient solution for my problem, but i have trouble finding indeces i,j.Does anyone have any idea?Thank you in advance.
2 Replies
Sort By:
Posted 10 years ago
 g[n_]:= Sum[f[n-i,i],{i,0,n}]
Posted 10 years ago
 This is exactly what I was looking for, I really appreciate your help. Take care!
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments