We look at the division of 500628 by 31 
The aim is to understand the frequency of 31 in 500628.

Let's proceed to step 1:
5 divided by 31 is 0 with a remainder of 5.
Use 0 as the next digit of our solution. 
Result so far: 0.0
The remainder is 5 after subtracting 0 from 5.
Include the next digit (0) from the dividend after 5, then repeat: 50 / 31

Going ahead to step 2:
31 can be fit into 50 1 times, resulting in a remainder of 19.
Use 1 as the next digit of our solution. 
Result so far: 1.0
Subtracting 31 from 50 leaves us with 19.
Bring next digit (0) of the dividend behind the 19 and repeat the process: 190 / 31

Let's proceed to step 3:
190 divided by 31 is 6 with a remainder of 4.
Record the quotient 6 as the next digit in the result. 
Result so far: 16.0
Subtract 186 from 190 to get 4.
Include the next digit (6) from the dividend after 4, then repeat: 46 / 31

Going ahead to step 4:
46 divided by 31 is 1 with a remainder of 15.
The next digit of our result is 1. 
Result so far: 161.0
Deduct 31 from 46 and we're left with 15.
Append the next digit (2) from the dividend to 15 and continue with: 152 / 31

Moving on to step 5:
The number 31 fits into 152 4 times, leaving a remainder of 28.
The number 4 becomes the next digit in our result. 
Result so far: 1614.0
Subtracting 124 from 152 leaves us with 28.
Fetch the next digit (8) from the dividend, attach it to 28 and continue: 288 / 31

Step 6:
When dividing 288 by 31, we get 9 with a remainder of 9.
The next digit of our result is 9. 
Result so far: 16149.0
Deduct 279 from 288 and we're left with 9.
Since there are no more digits in the dividend, we add a zero to the remainder making it 90, and continue the process.

Moving on to step 7:
31 can be fit into 90 2 times, resulting in a remainder of 28.
The next digit of our result is 2. 
Result so far: 16149.2
If we subtract 62 from 90, we get 28.
Since there are no more digits in the dividend, we add a zero to the remainder making it 280, and continue the process.

Going ahead to step 8:
280 divided by 31 is 9 with a remainder of 1.
Record the quotient 9 as the next digit in the result. 
Result so far: 16149.29
Subtract 279 from 280 to get 1.
Since there are no more digits in the dividend, we add a zero to the remainder making it 10, and continue the process.

Moving on to step 9:
31 can be fit into 10 0 times, resulting in a remainder of 10.
Write down 0 as next digit of the result. 
Result so far: 16149.29
If we take 0 away from 10, we end up with 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Moving on to step 10:
When dividing 100 by 31, we get 3 with a remainder of 7.
The next digit of our result is 3. 
Result so far: 16149.2903
Subtracting 93 from 100 leaves us with 7.
Since there are no more digits in the dividend, we add a zero to the remainder making it 70, and continue the process.

Going ahead to step 11:
31 goes into 70 2 times with a remainder of 8.
The number 2 becomes the next digit in our result. 
Result so far: 16149.29032
Subtract 62 from 70 to get 8.
Since there are no more digits in the dividend, we add a zero to the remainder making it 80, and continue the process.

On to step 12:
The number 31 fits into 80 2 times, leaving a remainder of 18.
Put 2 as the next digit of the answer. 
Result so far: 16149.290322
The remainder is 18 after subtracting 62 from 80.
Since there are no more digits in the dividend, we add a zero to the remainder making it 180, and continue the process.

In conclusion, the division gives 16149.290322 with a balance of 1.8e-06.