I'm trying to write stata code to recreate a probability estimate via this published equation, but I don't understand how the two summations relate to one another since there's no operator. Obviously pretty rusty on my summation algebra, so any guidance is appreciated!
I have values for:
$T=730$
$r=.00006084$
To be clear, I'm not really looking for the solution to the equation, but rather an explanation for how the equation "works" so that I can recreate it in stata (and therefore run using a bunch of different values for T and r). Thank you in advance!

This is a "nested" summation: $$\sum_{S=1}^{T-1}\left[r(1-r)^{S-1}\left(\sum_{D=S+1}^{T}\left\{1-(1-r)^{T-D+1}\right\}\left\{x(1-x)^{D-S-1}\right\}\right)\right]$$ It's an expression, not an equation, since there's no equals sign. The inner summation, for each $S$ of the outer summation, runs from $S+1$ to $T$.