MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Puzzled by Sum


Your logic is right. My experiment:

In[]:= A[i_, j_] := i/j + j/i

In[]:= Hold[Sum[A[i - j, j], {j, 1, i - 1}]] /. i -> X
Out[] = Hold[something]


In[]:= F[X_] := something (* Just copy&paste something we obtained above.*)
In[]:= F[2]
Out[] = 2

Hence, I cannot see the reason your def. doesn't work.
======
The following variations all work tho:

In[]:= A[i_, j_] := i/j + j/i

In[]:= F[X_] := (Sum[A[X - j, j], {j, 1, X - 1}])


In[]:= F[X_] := Block[{i = X}, Sum[A[i - j, j], {j, 1, i - 1}]]


In[]:= F[X_] := (i = X; Sum[A[i - j, j], {j, 1, i - 1}])



  • Prev by Date: Re: GramSchmidt function
  • Next by Date: Re: GramSchmidt function
  • Previous by thread: Re: Puzzled by Sum
  • Next by thread: Re: Puzzled by Sum