We can already find X it is the first entry where the GCD of (d(e,1) - d(e,n)) and a(e,1) is not equal to 1. Moreover this GCD is a factor of the original number.
The even E and odd E have to do with where you start your X value. For even E, you start with X=0, and with odd E you start with X=1. You calculate your first D by the equation:
D = (X*(X+2) + E)/2
Also this E even or odd has to do with how much you shift D by each successive entry. If E is even, then your shift starts at 4, if you're at an odd E, it starts at 6. With each successive entry in the cell, you increase the shift by 4.
Ex: (odd E)
D1 = D0 + 6
D2 = D1 + 10
D3 = D2 + 14
So those are your decisions
You just iterate through the values in the e,1 cell so I guess it's a search. The thing is it works with every D value (including D=0) so I've been thinking that we may be able to cancel out D entirely from the equation or generating a system of equations for multiple D's to then simplify it but I haven't figured out exactly what I'm doing with that