I could not access elements from the integer array in bash and add the two.
This is my code:
popA[$n]=${popA[$n]} - ${popA[($n)-1]};
You are accessing the elements correctly, but you need an arithmetic expression to actually perform math:
popA[$n]=$(( ${popA[$n]} - ${popA[$n - 1]} ))
In case you are wondering why you don't need $((...)) for the n-1 index, the array subscript is automatically evaluated as an arithmetic expression for an indexed array. (The parentheses around $n are unnecessary, although harmless.)