CA Here, like usual doing my own thing. Have we tried this algorithm?
Take your start value c. Then make values e,n,d,x,a,b. Make a new value (c-n). Repeat with (c-n). It works a decent amount. But the problem is dealing with the parity because to make a record you need (a,b) to have the same parity. I've so far just taken away the largest power of 2 that I can from the number and I make the next record b-n.