Pic attached for c=6107 is an attempt to understand the staircase number breakdown for values of f that could be used to speed up the iteration process.
Both images are for the x+n=83 small square where f=134.
The left square follows my previous diagrams >>5664 with f in the center and nn around the edges. The main difference is that the -1 from the nn + 2d(n-1) + f - 1 formula has been moved from the nn portion into the f portion in the center.
The light blue squares indicate the f mod 8 = 6 value. And the total of blue, light blue, and the orange square in the middle is now f-1 = 133.
In the right square, is the idea for splitting the f-1 portion into 2 separate groups of 4 triangles each. The dark blue represents 4 triangles made up of the staircase number 4+5+6 = 15 for a total of 60. And the blue and light blue triangles are 4 triangles of 5+6+7 = 18 for a total of 72.
60 + 72 + the orange square in the middle gets us back to the f - 1 = 133 number.
Interesting to note that the 60 + 72 staircase numbers equal our f - 2 iteration chunk of 132.