# Maple 13. How to find sum of entiries of array via summation operator?

#### ICanFly

I understand i can use loop (like "for..." or something else ) but i want do my program text more readable.
I declare array:
Code:
 A:=Array(1..5,[1,2,3,4,5])
It is OK.Then i trying to get sum of entries of array
Code:
S:=sum(A[i],i=1..5)
This yields error "Error,bad index into Array"
How can i fix it?

#### Jester

MHF Helper
I understand i can use loop (like "for..." or something else ) but i want do my program text more readable.
I declare array:
Code:
 A:=Array(1..5,[1,2,3,4,5])
It is OK.Then i trying to get sum of entries of array
Code:
S:=sum(A[i],i=1..5)
This yields error "Error,bad index into Array"
How can i fix it?
Not sure why sum doesn't work but add does.

ICanFly