Let's divide 502670 by 31
The aim is to understand the frequency of 31 in 502670.

Step 1:
If we divide 5 by 31, we get 0 and a remainder of 5.
Use 0 as the next digit of our solution. 
Result so far: 0.0
Subtracting 0 from 5 leaves us with 5.
Grab the next digit (0) from the dividend, add it to 5, then carry on: 50 / 31

Moving on to step 2:
If we divide 50 by 31, we get 1 and a remainder of 19.
Write down 1 as next digit of the result. 
Result so far: 1.0
If we subtract 31 from 50, we get 19.
Fetch the next digit (2) from the dividend, attach it to 19 and continue: 192 / 31

Let's proceed to step 3:
192 divided by 31 is 6 with a remainder of 6.
The number 6 becomes the next digit in our result. 
Result so far: 16.0
Deduct 186 from 192 and we're left with 6.
Bring next digit (6) of the dividend behind the 6 and repeat the process: 66 / 31

Going ahead to step 4:
31 goes into 66 2 times with a remainder of 4.
The next digit of our result is 2. 
Result so far: 162.0
If we subtract 62 from 66, we get 4.
Fetch the next digit (7) from the dividend, attach it to 4 and continue: 47 / 31

Let's proceed to step 5:
47 divided by 31 is 1 with a remainder of 16.
The next digit of our result is 1. 
Result so far: 1621.0
Deduct 31 from 47 and we're left with 16.
Take the next digit (0) from the dividend and append it to 16, then repeat: 160 / 31

Let's proceed to step 6:
If we divide 160 by 31, we get 5 and a remainder of 5.
Write down 5 as next digit of the result. 
Result so far: 16215.0
Subtracting 155 from 160 leaves us with 5.
Since there are no more digits in the dividend, we add a zero to the remainder making it 50, and continue the process.

On to step 7:
50 divided by 31 is 1 with a remainder of 19.
Write down 1 as next digit of the result. 
Result so far: 16215.1
Deduct 31 from 50 and we're left with 19.
Since there are no more digits in the dividend, we add a zero to the remainder making it 190, and continue the process.

Step 8:
31 goes into 190 6 times with a remainder of 4.
Record the quotient 6 as the next digit in the result. 
Result so far: 16215.16
Deduct 186 from 190 and we're left with 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

On to step 9:
The number 31 fits into 40 1 times, leaving a remainder of 9.
Write down 1 as next digit of the result. 
Result so far: 16215.161
Subtracting 31 from 40 leaves us 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.

Step 10:
The number 31 fits into 90 2 times, leaving a remainder of 28.
The number 2 becomes the next digit in our result. 
Result so far: 16215.1612
Subtract 62 from 90 to 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.

Advancing to step 11:
If we divide 280 by 31, we get 9 and a remainder of 1.
Put 9 as the next digit of the answer. 
Result so far: 16215.16129
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.

Advancing to step 12:
When dividing 10 by 31, we get 0 with a remainder of 10.
The number 0 becomes the next digit in our result. 
Result so far: 16215.16129
The remainder is 10 after subtracting 0 from 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Going ahead to step 13:
31 can be fit into 100 3 times, resulting in a remainder of 7.
The number 3 becomes the next digit in our result. 
Result so far: 16215.1612903
Subtract 93 from 100 to get 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 14:
70 divided by 31 is 2 with a remainder of 8.
Write down 2 as next digit of the result. 
Result so far: 16215.16129032
Subtracting 62 from 70 leaves us with 8.
Since there are no more digits in the dividend, we add a zero to the remainder making it 80, and continue the process.

The quotient of the division is 16215.16129032, and the remainder is 8e-09.