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

Going ahead to step 1:
If we divide 3 by 31, we get 0 and a remainder of 3.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we take 0 away from 3, we end up with 3.
Append the next digit (3) from the dividend to 3 and continue with: 33 / 31

Going ahead to step 2:
31 goes into 33 1 times with a remainder of 2.
The number 1 becomes the next digit in our result. 
Result so far: 1.0
Subtract 31 from 33 to get 2.
Grab the next digit (1) from the dividend, add it to 2, then carry on: 21 / 31

Let's proceed to step 3:
If we divide 21 by 31, we get 0 and a remainder of 21.
Record the quotient 0 as the next digit in the result. 
Result so far: 10.0
The remainder is 21 after subtracting 0 from 21.
Grab the next digit (8) from the dividend, add it to 21, then carry on: 218 / 31

On to step 4:
When dividing 218 by 31, we get 7 with a remainder of 1.
The number 7 becomes the next digit in our result. 
Result so far: 107.0
Subtract 217 from 218 to get 1.
Take the next digit (9) from the dividend and append it to 1, then repeat: 19 / 31

Going ahead to step 5:
31 goes into 19 0 times with a remainder of 19.
Use 0 as the next digit of our solution. 
Result so far: 1070.0
Subtract 0 from 19 to get 19.
Bring next digit (4) of the dividend behind the 19 and repeat the process: 194 / 31

Let's proceed to step 6:
194 divided by 31 is 6 with a remainder of 8.
The number 6 becomes the next digit in our result. 
Result so far: 10706.0
If we take 186 away from 194, we end up 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.

Let's proceed to step 7:
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: 10706.2
Subtracting 62 from 80 leaves us with 18.
Since there are no more digits in the dividend, we add a zero to the remainder making it 180, and continue the process.

Step 8:
31 can be fit into 180 5 times, resulting in a remainder of 25.
Write down 5 as next digit of the result. 
Result so far: 10706.25
Subtract 155 from 180 to get 25.
Since there are no more digits in the dividend, we add a zero to the remainder making it 250, and continue the process.

On to step 9:
250 divided by 31 is 8 with a remainder of 2.
The number 8 becomes the next digit in our result. 
Result so far: 10706.258
Deduct 248 from 250 and we're left with 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

Let's proceed to step 10:
If we divide 20 by 31, we get 0 and a remainder of 20.
The number 0 becomes the next digit in our result. 
Result so far: 10706.258
If we subtract 0 from 20, we get 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Moving on to step 11:
If we divide 200 by 31, we get 6 and a remainder of 14.
The next digit of our result is 6. 
Result so far: 10706.25806
If we subtract 186 from 200, we get 14.
Since there are no more digits in the dividend, we add a zero to the remainder making it 140, and continue the process.

Step 12:
31 can be fit into 140 4 times, resulting in a remainder of 16.
Use 4 as the next digit of our solution. 
Result so far: 10706.258064
If we take 124 away from 140, we end up with 16.
Since there are no more digits in the dividend, we add a zero to the remainder making it 160, and continue the process.

Moving on to step 13:
31 goes into 160 5 times with a remainder of 5.
Record the quotient 5 as the next digit in the result. 
Result so far: 10706.2580645
If we take 155 away from 160, we end up 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.

Step 14:
50 divided by 31 is 1 with a remainder of 19.
Use 1 as the next digit of our solution. 
Result so far: 10706.25806451
Subtracting 31 from 50 leaves us 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.

The final result is 10706.25806451 with a remainder of 1.9e-08.