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

Going ahead to step 1:
The number 31 fits into 7 0 times, leaving a remainder of 7.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we subtract 0 from 7, we get 7.
Take the next digit (8) from the dividend and append it to 7, then repeat: 78 / 31

Let's proceed to step 2:
31 goes into 78 2 times with a remainder of 16.
Use 2 as the next digit of our solution. 
Result so far: 2.0
Deduct 62 from 78 and we're left with 16.
Take the next digit (7) from the dividend and append it to 16, then repeat: 167 / 31

On to step 3:
31 goes into 167 5 times with a remainder of 12.
The next digit of our result is 5. 
Result so far: 25.0
Subtract 155 from 167 to get 12.
Bring next digit (1) of the dividend behind the 12 and repeat the process: 121 / 31

Let's proceed to step 4:
The number 31 fits into 121 3 times, leaving a remainder of 28.
The number 3 becomes the next digit in our result. 
Result so far: 253.0
Subtract 93 from 121 to get 28.
Include the next digit (3) from the dividend after 28, then repeat: 283 / 31

Moving on to step 5:
31 goes into 283 9 times with a remainder of 4.
Write down 9 as next digit of the result. 
Result so far: 2539.0
Subtract 279 from 283 to get 4.
Fetch the next digit (8) from the dividend, attach it to 4 and continue: 48 / 31

Advancing to step 6:
When dividing 48 by 31, we get 1 with a remainder of 17.
Record the quotient 1 as the next digit in the result. 
Result so far: 25391.0
Deduct 31 from 48 and we're left with 17.
Since there are no more digits in the dividend, we add a zero to the remainder making it 170, and continue the process.

Moving on to step 7:
If we divide 170 by 31, we get 5 and a remainder of 15.
The number 5 becomes the next digit in our result. 
Result so far: 25391.5
Deduct 155 from 170 and we're left with 15.
Since there are no more digits in the dividend, we add a zero to the remainder making it 150, and continue the process.

Advancing to step 8:
150 divided by 31 is 4 with a remainder of 26.
The number 4 becomes the next digit in our result. 
Result so far: 25391.54
The remainder is 26 after subtracting 124 from 150.
Since there are no more digits in the dividend, we add a zero to the remainder making it 260, and continue the process.

Moving on to step 9:
The number 31 fits into 260 8 times, leaving a remainder of 12.
Put 8 as the next digit of the answer. 
Result so far: 25391.548
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.

Moving on to step 10:
The number 31 fits into 120 3 times, leaving a remainder of 27.
Use 3 as the next digit of our solution. 
Result so far: 25391.5483
Subtract 93 from 120 to 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.

Going ahead to step 11:
If we divide 270 by 31, we get 8 and a remainder of 22.
Put 8 as the next digit of the answer. 
Result so far: 25391.54838
Subtracting 248 from 270 leaves us 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 12:
220 divided by 31 is 7 with a remainder of 3.
Write down 7 as next digit of the result. 
Result so far: 25391.548387
If we take 217 away from 220, we end up 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.

Let's proceed to step 13:
When dividing 30 by 31, we get 0 with a remainder of 30.
The next digit of our result is 0. 
Result so far: 25391.548387
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.

On to step 14:
31 goes into 300 9 times with a remainder of 21.
The number 9 becomes the next digit in our result. 
Result so far: 25391.54838709
If we subtract 279 from 300, we get 21.
Since there are no more digits in the dividend, we add a zero to the remainder making it 210, and continue the process.

The quotient of the division is 25391.54838709, and the remainder is 2.1e-08.