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

Step 1:
If we divide 4 by 31, we get 0 and a remainder of 4.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we subtract 0 from 4, we get 4.
Grab the next digit (0) from the dividend, add it to 4, then carry on: 40 / 31

Going ahead to step 2:
The number 31 fits into 40 1 times, leaving a remainder of 9.
Put 1 as the next digit of the answer. 
Result so far: 1.0
If we subtract 31 from 40, we get 9.
Take the next digit (0) from the dividend and append it to 9, then repeat: 90 / 31

Let's proceed to step 3:
When dividing 90 by 31, we get 2 with a remainder of 28.
The next digit of our result is 2. 
Result so far: 12.0
Subtracting 62 from 90 leaves us with 28.
Take the next digit (1) from the dividend and append it to 28, then repeat: 281 / 31

Step 4:
If we divide 281 by 31, we get 9 and a remainder of 2.
The next digit of our result is 9. 
Result so far: 129.0
Subtract 279 from 281 to get 2.
Append the next digit (4) from the dividend to 2 and continue with: 24 / 31

Let's proceed to step 5:
When dividing 24 by 31, we get 0 with a remainder of 24.
Write down 0 as next digit of the result. 
Result so far: 1290.0
If we subtract 0 from 24, we get 24.
Append the next digit (7) from the dividend to 24 and continue with: 247 / 31

Let's proceed to step 6:
The number 31 fits into 247 7 times, leaving a remainder of 30.
The next digit of our result is 7. 
Result so far: 12907.0
Subtract 217 from 247 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.

On to step 7:
31 goes into 300 9 times with a remainder of 21.
The number 9 becomes the next digit in our result. 
Result so far: 12907.9
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.

Advancing to step 8:
31 goes into 210 6 times with a remainder of 24.
The number 6 becomes the next digit in our result. 
Result so far: 12907.96
Deduct 186 from 210 and we're left with 24.
Since there are no more digits in the dividend, we add a zero to the remainder making it 240, and continue the process.

Moving on to step 9:
31 goes into 240 7 times with a remainder of 23.
Record the quotient 7 as the next digit in the result. 
Result so far: 12907.967
Subtracting 217 from 240 leaves us 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.

Advancing to step 10:
31 can be fit into 230 7 times, resulting in a remainder of 13.
Record the quotient 7 as the next digit in the result. 
Result so far: 12907.9677
Subtracting 217 from 230 leaves us with 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 final outcome is 12907.9677, with a leftover of 0.00013.