(x1000 - x500 - 1)/(x - 1)
(x1000 + 0x999 + ... + 0x501 - x500 + ... + 0x - 1)/(x - 1)
Now you can find the remainder, if you like...
26.75
168.4
49.619
22.8372
35
1628.5
11.0503
127.6
To find the remainder you can do the 'chunking' method. This would leave you with a remainder of 2 because 4x9=36 38-36=2
23.25
6.5
48.8