Looks like you ended up with an extra factor of 2 starting with the line:
c+1 = (a-1)2(b-1) + a+b
Without that, the algebra does check out.
Well, I mean, it's algebraically possible to start from the (x+n)^2 equation and rearrange it to solve for sqrt(2d), but the result isn't useful since it still depends on x, n, and f.
Both d and e are easily calculated directly from c, so I'm not sure what good isolating sqrt(2d) or sqrt(e) does.
Sure, let me do the algebra, though again I warn you that I don't think the result is particularly elegant or useful. We start with the (x+n)^2 equation you had:
(x+n)(x+n) = 2d(n-1) + nn + f – 1
x^2 + 2nx + n^2 = 2d(n-1) + n^2 + f - 1
x^2 + 2nx - f + 1 = 2d(n-1)
(x^2 + 2nx - f + 1) / (n-1) = 2d
sqrt( (x^2 + 2nx - f + 1) / (n-1) ) = sqrt(2d)
That's what solving for sqrt(2d) gives you.
A quick check with the c=559 record:
sqrt( (10^2 + 2510 - 17 + 1) / (5-1) ) = sqrt(2*23)
sqrt( (100 + 100 - 16) / 4 ) = sqrt(46)
sqrt( 184 / 4 ) = sqrt(46)
sqrt(46) = sqrt(46)