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

Going ahead to step 1:
The number 31 fits into 5 0 times, leaving a remainder of 5.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
Deduct 0 from 5 and we're left with 5.
Take the next digit (0) from the dividend and append it to 5, then repeat: 50 / 31

Step 2:
31 goes into 50 1 times with a remainder of 19.
The next digit of our result is 1. 
Result so far: 1.0
The remainder is 19 after subtracting 31 from 50.
Take the next digit (6) from the dividend and append it to 19, then repeat: 196 / 31

On to step 3:
If we divide 196 by 31, we get 6 and a remainder of 10.
Write down 6 as next digit of the result. 
Result so far: 16.0
If we take 186 away from 196, we end up with 10.
Append the next digit (9) from the dividend to 10 and continue with: 109 / 31

On to step 4:
31 goes into 109 3 times with a remainder of 16.
Use 3 as the next digit of our solution. 
Result so far: 163.0
Deduct 93 from 109 and we're left with 16.
Fetch the next digit (5) from the dividend, attach it to 16 and continue: 165 / 31

Advancing to step 5:
If we divide 165 by 31, we get 5 and a remainder of 10.
Put 5 as the next digit of the answer. 
Result so far: 1635.0
The remainder is 10 after subtracting 155 from 165.
Append the next digit (4) from the dividend to 10 and continue with: 104 / 31

Let's proceed to step 6:
If we divide 104 by 31, we get 3 and a remainder of 11.
Write down 3 as next digit of the result. 
Result so far: 16353.0
The remainder is 11 after subtracting 93 from 104.
Since there are no more digits in the dividend, we add a zero to the remainder making it 110, and continue the process.

Let's proceed to step 7:
If we divide 110 by 31, we get 3 and a remainder of 17.
Record the quotient 3 as the next digit in the result. 
Result so far: 16353.3
If we subtract 93 from 110, we get 17.
Since there are no more digits in the dividend, we add a zero to the remainder making it 170, and continue the process.

Going ahead to step 8:
31 goes into 170 5 times with a remainder of 15.
Use 5 as the next digit of our solution. 
Result so far: 16353.35
The remainder is 15 after subtracting 155 from 170.
Since there are no more digits in the dividend, we add a zero to the remainder making it 150, and continue the process.

Advancing to step 9:
When dividing 150 by 31, we get 4 with a remainder of 26.
Put 4 as the next digit of the answer. 
Result so far: 16353.354
The remainder is 26 after subtracting 124 from 150.
Since there are no more digits in the dividend, we add a zero to the remainder making it 260, and continue the process.

On to step 10:
31 can be fit into 260 8 times, resulting in a remainder of 12.
The next digit of our result is 8. 
Result so far: 16353.3548
If we subtract 248 from 260, we get 12.
Since there are no more digits in the dividend, we add a zero to the remainder making it 120, and continue the process.

Step 11:
The number 31 fits into 120 3 times, leaving a remainder of 27.
Use 3 as the next digit of our solution. 
Result so far: 16353.35483
Subtracting 93 from 120 leaves us with 27.
Since there are no more digits in the dividend, we add a zero to the remainder making it 270, and continue the process.

Moving on to step 12:
270 divided by 31 is 8 with a remainder of 22.
The number 8 becomes the next digit in our result. 
Result so far: 16353.354838
If we subtract 248 from 270, we get 22.
Since there are no more digits in the dividend, we add a zero to the remainder making it 220, and continue the process.

On to step 13:
220 divided by 31 is 7 with a remainder of 3.
Write down 7 as next digit of the result. 
Result so far: 16353.3548387
Subtracting 217 from 220 leaves us with 3.
Since there are no more digits in the dividend, we add a zero to the remainder making it 30, and continue the process.

Going ahead to step 14:
When dividing 30 by 31, we get 0 with a remainder of 30.
Use 0 as the next digit of our solution. 
Result so far: 16353.3548387
If we subtract 0 from 30, we get 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

The final outcome is 16353.3548387, with a leftover of 3e-08.