396254 divided by 31 
The aim is to understand the frequency of 31 in 396254.

Step 1:
31 can be fit into 3 0 times, resulting in a remainder of 3.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we subtract 0 from 3, we get 3.
Take the next digit (9) from the dividend and append it to 3, then repeat: 39 / 31

Advancing to step 2:
The number 31 fits into 39 1 times, leaving a remainder of 8.
Write down 1 as next digit of the result. 
Result so far: 1.0
Subtract 31 from 39 to get 8.
Include the next digit (6) from the dividend after 8, then repeat: 86 / 31

Going ahead to step 3:
31 goes into 86 2 times with a remainder of 24.
Record the quotient 2 as the next digit in the result. 
Result so far: 12.0
If we take 62 away from 86, we end up with 24.
Grab the next digit (2) from the dividend, add it to 24, then carry on: 242 / 31

Moving on to step 4:
242 divided by 31 is 7 with a remainder of 25.
Record the quotient 7 as the next digit in the result. 
Result so far: 127.0
Deduct 217 from 242 and we're left with 25.
Append the next digit (5) from the dividend to 25 and continue with: 255 / 31

Advancing to step 5:
The number 31 fits into 255 8 times, leaving a remainder of 7.
The next digit of our result is 8. 
Result so far: 1278.0
Deduct 248 from 255 and we're left with 7.
Grab the next digit (4) from the dividend, add it to 7, then carry on: 74 / 31

On to step 6:
31 can be fit into 74 2 times, resulting in a remainder of 12.
Use 2 as the next digit of our solution. 
Result so far: 12782.0
Subtract 62 from 74 to 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 7:
When dividing 120 by 31, we get 3 with a remainder of 27.
The number 3 becomes the next digit in our result. 
Result so far: 12782.3
If we subtract 93 from 120, we get 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 8:
When dividing 270 by 31, we get 8 with a remainder of 22.
The next digit of our result is 8. 
Result so far: 12782.38
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.

On to step 9:
31 can be fit into 220 7 times, resulting in a remainder of 3.
Put 7 as the next digit of the answer. 
Result so far: 12782.387
The remainder is 3 after subtracting 217 from 220.
Since there are no more digits in the dividend, we add a zero to the remainder making it 30, and continue the process.

Advancing to step 10:
31 can be fit into 30 0 times, resulting in a remainder of 30.
Record the quotient 0 as the next digit in the result. 
Result so far: 12782.387
Deduct 0 from 30 and we're left with 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

Advancing to step 11:
If we divide 300 by 31, we get 9 and a remainder of 21.
Put 9 as the next digit of the answer. 
Result so far: 12782.38709
Subtracting 279 from 300 leaves us 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.

Let's proceed to step 12:
210 divided by 31 is 6 with a remainder of 24.
The next digit of our result is 6. 
Result so far: 12782.387096
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.

Step 13:
31 goes into 240 7 times with a remainder of 23.
The number 7 becomes the next digit in our result. 
Result so far: 12782.3870967
If we take 217 away from 240, we end up with 23.
Since there are no more digits in the dividend, we add a zero to the remainder making it 230, and continue the process.

Moving on to step 14:
The number 31 fits into 230 7 times, leaving a remainder of 13.
Write down 7 as next digit of the result. 
Result so far: 12782.38709677
Subtract 217 from 230 to get 13.
Since there are no more digits in the dividend, we add a zero to the remainder making it 130, and continue the process.

The quotient of the division is 12782.38709677, and the remainder is 1.3e-08.