398670 ÷ 31 
The aim is to understand the frequency of 31 in 398670.

Advancing to step 1:
31 goes into 3 0 times with a remainder of 3.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we take 0 away from 3, we end up with 3.
Include the next digit (9) from the dividend after 3, then repeat: 39 / 31

Moving on to step 2:
31 can be fit into 39 1 times, resulting in a remainder of 8.
Record the quotient 1 as the next digit in the result. 
Result so far: 1.0
If we subtract 31 from 39, we get 8.
Grab the next digit (8) from the dividend, add it to 8, then carry on: 88 / 31

Advancing to step 3:
88 divided by 31 is 2 with a remainder of 26.
Record the quotient 2 as the next digit in the result. 
Result so far: 12.0
If we subtract 62 from 88, we get 26.
Grab the next digit (6) from the dividend, add it to 26, then carry on: 266 / 31

Let's proceed to step 4:
31 can be fit into 266 8 times, resulting in a remainder of 18.
The next digit of our result is 8. 
Result so far: 128.0
Deduct 248 from 266 and we're left with 18.
Append the next digit (7) from the dividend to 18 and continue with: 187 / 31

On to step 5:
31 can be fit into 187 6 times, resulting in a remainder of 1.
The next digit of our result is 6. 
Result so far: 1286.0
If we take 186 away from 187, we end up with 1.
Fetch the next digit (0) from the dividend, attach it to 1 and continue: 10 / 31

Step 6:
10 divided by 31 is 0 with a remainder of 10.
Write down 0 as next digit of the result. 
Result so far: 12860.0
If we subtract 0 from 10, we get 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Step 7:
If we divide 100 by 31, we get 3 and a remainder of 7.
Use 3 as the next digit of our solution. 
Result so far: 12860.3
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.

Advancing to step 8:
70 divided by 31 is 2 with a remainder of 8.
Write down 2 as next digit of the result. 
Result so far: 12860.32
The remainder is 8 after subtracting 62 from 70.
Since there are no more digits in the dividend, we add a zero to the remainder making it 80, and continue the process.

Going ahead to step 9:
When dividing 80 by 31, we get 2 with a remainder of 18.
The number 2 becomes the next digit in our result. 
Result so far: 12860.322
If we take 62 away from 80, we end up 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.

Our division results in 12860.322 with a remaining 0.0018.