Two "bubble" loops in pseudocode; would they return the same thing? I am trying to create a new form of a bubble loop and want to see if they would return the same truth values during runtime. Could I get a second pair of eyes to confirm if this is the case?
Note: prod is equal to a target product of a sequence.
Code #1
For c = 1 to x
For d = 1 to c - 1
If (a,c * a,d = prod) return True 
End For

Code #2
For c = 1 to x
For d = c + 1 to x
If (a,c * a,d = prod) return True 
End For

I did data collection and found that in each case, the return true value would be the same. Is this always the case? If so, is this just because our index is simply starting at the second to the beginning as compared to skipping the end?
In the first code, the values taken by $(c, d)$ are in the set $\{(c, d)| 1 \leq d &lt; c \leq x\}$. In the second code, the set is $\{(c,d)|1\leq c &lt; d \leq x\}$. Since $c$ and $d$ play symmetrical roles in the boolean test, it is expected that you obtain the same result.
Note that if $c$ and $d$ would not play symmetrical roles, the result could be different (for example, if the test was a, c * d, a = prod).