Animation Nodes : Use Previous output of a Loop in calculation of the next iteration
You can do this by using 'reassign'.

This is an option accessible from the 'loop subprogram' and which allow to obtain a node from which you can reassign an input parameter from some calculated result inside the subprogram.


Select the subprogram.
Go into the properties on the right, in the node tab, then click 'reassign' for the input you want.
That generates a reassign node, place it in the grid.




Now you can connect its input from the calculation you want (here probably the loop result).