We're dividing 397849 by 31 
The aim is to understand the frequency of 31 in 397849.

Advancing to step 1:
3 divided by 31 is 0 with a remainder of 3.
The next digit of our result is 0. 
Result so far: 0.0
If we take 0 away from 3, we end up with 3.
Grab the next digit (9) from the dividend, add it to 3, then carry on: 39 / 31

Moving on to step 2:
The number 31 fits into 39 1 times, leaving a remainder of 8.
Record the quotient 1 as the next digit in the result. 
Result so far: 1.0
Deduct 31 from 39 and we're left with 8.
Include the next digit (7) from the dividend after 8, then repeat: 87 / 31

Let's proceed to step 3:
31 goes into 87 2 times with a remainder of 25.
Record the quotient 2 as the next digit in the result. 
Result so far: 12.0
Deduct 62 from 87 and we're left with 25.
Append the next digit (8) from the dividend to 25 and continue with: 258 / 31

Step 4:
31 can be fit into 258 8 times, resulting in a remainder of 10.
Record the quotient 8 as the next digit in the result. 
Result so far: 128.0
Subtract 248 from 258 to get 10.
Take the next digit (4) from the dividend and append it to 10, then repeat: 104 / 31

Moving on to step 5:
31 can be fit into 104 3 times, resulting in a remainder of 11.
The number 3 becomes the next digit in our result. 
Result so far: 1283.0
Subtract 93 from 104 to get 11.
Take the next digit (9) from the dividend and append it to 11, then repeat: 119 / 31

Let's proceed to step 6:
When dividing 119 by 31, we get 3 with a remainder of 26.
The number 3 becomes the next digit in our result. 
Result so far: 12833.0
The remainder is 26 after subtracting 93 from 119.
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 7:
31 goes into 260 8 times with a remainder of 12.
The next digit of our result is 8. 
Result so far: 12833.8
Deduct 248 from 260 and we're left with 12.
Since there are no more digits in the dividend, we add a zero to the remainder making it 120, and continue the process.

On to step 8:
120 divided by 31 is 3 with a remainder of 27.
The next digit of our result is 3. 
Result so far: 12833.83
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.

Advancing to step 9:
31 can be fit into 270 8 times, resulting in a remainder of 22.
The next digit of our result is 8. 
Result so far: 12833.838
Deduct 248 from 270 and we're left with 22.
Since there are no more digits in the dividend, we add a zero to the remainder making it 220, and continue the process.

Moving on to step 10:
220 divided by 31 is 7 with a remainder of 3.
The next digit of our result is 7. 
Result so far: 12833.8387
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 11:
If we divide 30 by 31, we get 0 and a remainder of 30.
Write down 0 as next digit of the result. 
Result so far: 12833.8387
Subtract 0 from 30 to 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.

Step 12:
If we divide 300 by 31, we get 9 and a remainder of 21.
The next digit of our result is 9. 
Result so far: 12833.838709
If we take 279 away from 300, we end up with 21.
Since there are no more digits in the dividend, we add a zero to the remainder making it 210, and continue the process.

On to step 13:
210 divided by 31 is 6 with a remainder of 24.
Record the quotient 6 as the next digit in the result. 
Result so far: 12833.8387096
If we subtract 186 from 210, we get 24.
Since there are no more digits in the dividend, we add a zero to the remainder making it 240, and continue the process.

Advancing to step 14:
If we divide 240 by 31, we get 7 and a remainder of 23.
Use 7 as the next digit of our solution. 
Result so far: 12833.83870967
If we subtract 217 from 240, we get 23.
Since there are no more digits in the dividend, we add a zero to the remainder making it 230, and continue the process.

Our division results in 12833.83870967 with a remaining 2.3e-08.