I have a long summation with many (thousands) addends like 1+1/(1+a) +1/(1+b)-3/(7+c)+ … .
Is there a simple built -in function in Mathematica that can count the addends of a long algebraic summation ?
I mean a function that can count the number of terms added and/or subtracted ?
Or do I have to convert the summation to a list by changing the + and - signs to commas?
In[3]:= Length[1 + 1/(1 + a) + 1/(1 + b) + 3/(7 + c)]
Out[3]= 4
That will work as long as the head of the entire expression is Plus, which includes expressions containing negative terms.
since they are internalized as negative numbers times expressions,
and the whole expression doesn’t automatically simplify.
Thank you very much. That answers my question.