I may have found an alternate way to iterate. Not sure how effective it will be, but it's interesting nonetheless.
Attached pics are for c=209325931.
Using the current linear approach of incrementing f-2 div 40 chunks, it takes 51699 iterations to solve. The solution is found in the 12th increment of the T(est u) triangle, and at the 4886th iteration in remainder portion T(rm u).
We can calculate the "triangle base" for the remainder portion by T(rm u) - T(est u).
Here's the interesting part.
If you divide this "triangle base" by (f-2 div 40), you get a u that is exactly half way between the rm u and est u values. And the "triangle base" mod (f-2 div 40) is 1/2 the starting (f-2 div 40).
If you repeat that calculation, you basically find a way to subdivide the triangle base between T(rm u) and T(est u) by valid chunks of (f-2 div 40), but using triangle values instead of increments.
For example, at iteration 12:
(f-2) div 40 = 650
(T(8450) - T(7800)) / 650 = 8125 with remainder 325
The next iterations:
(T(8125) - T(7800)) / 325 = 7963
(T(7963) - T(7800)) / 162 = 7930
and so on.
The rm_u_tree pic attached is the partial result of a parse tree that starts from the mid point between est u and rm u, and splits u values in both the positive and negative direction. So the triangle base is divided into 1/2, 1/4, 1/8, 1/16, 1/32, etc in a tree structure until the leaf nodes are just 1 u apart.
There are only 255 entries for this parse tree, so we're down to 3060 total calculations to solve. But most likely a few less than that. Notice from the picture that T(8196) is only 5 levels down in this tree, and is only 1 away from the prime solution of 8197.