I am looking for a calculation to solve the following math problem:
For any integer between 1 and 100000, how many of the following increments are there
1000
500
250
100
50
10
1
Example:
1042 contains the following
1 - 1000
0 - 500
0 - 250
0 - 100
0 - 50
4 - 10
2 - 1

For any integer between 1 and 100000, how many of the following increments are there
1000
500
250
100
50
10
1
Example:
1042 contains the following
1 - 1000
0 - 500
0 - 250
0 - 100
0 - 50
4 - 10
2 - 1