We divide 31787 by 31
The aim is to understand the frequency of 31 in 31787.

Advancing to step 1:
If we divide 3 by 31, we get 0 and a remainder of 3.
Put 0 as the next digit of the answer. 
Result so far: 0.0
Subtract 0 from 3 to get 3.
Bring next digit (1) of the dividend behind the 3 and repeat the process: 31 / 31

Going ahead to step 2:
When dividing 31 by 31, we get 1 with a remainder of 0.
Write down 1 as next digit of the result. 
Result so far: 1.0
Subtracting 31 from 31 leaves us with 0.
Append the next digit (7) from the dividend to 0 and continue with: 7 / 31

Let's proceed to step 3:
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: 10.0
The remainder is 7 after subtracting 0 from 7.
Append the next digit (8) from the dividend to 7 and continue with: 78 / 31

Advancing to step 4:
78 divided by 31 is 2 with a remainder of 16.
Put 2 as the next digit of the answer. 
Result so far: 102.0
Subtracting 62 from 78 leaves us with 16.
Grab the next digit (7) from the dividend, add it to 16, then carry on: 167 / 31

Moving on to step 5:
167 divided by 31 is 5 with a remainder of 12.
Put 5 as the next digit of the answer. 
Result so far: 1025.0
Deduct 155 from 167 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.

Going ahead to step 6:
31 goes into 120 3 times with a remainder of 27.
The number 3 becomes the next digit in our result. 
Result so far: 1025.3
If we take 93 away from 120, we end up 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.

Going ahead to step 7:
31 can be fit into 270 8 times, resulting in a remainder of 22.
The number 8 becomes the next digit in our result. 
Result so far: 1025.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.

Advancing to step 8:
31 goes into 220 7 times with a remainder of 3.
Write down 7 as next digit of the result. 
Result so far: 1025.387
Subtract 217 from 220 to get 3.
Since there are no more digits in the dividend, we add a zero to the remainder making it 30, and continue the process.

Step 9:
31 goes into 30 0 times with a remainder of 30.
The next digit of our result is 0. 
Result so far: 1025.387
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 10:
When dividing 300 by 31, we get 9 with a remainder of 21.
The number 9 becomes the next digit in our result. 
Result so far: 1025.38709
Deduct 279 from 300 and we're left 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.

Moving on to step 11:
When dividing 210 by 31, we get 6 with a remainder of 24.
The next digit of our result is 6. 
Result so far: 1025.387096
The remainder is 24 after subtracting 186 from 210.
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 12:
31 goes into 240 7 times with a remainder of 23.
Write down 7 as next digit of the result. 
Result so far: 1025.3870967
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.

On to step 13:
The number 31 fits into 230 7 times, leaving a remainder of 13.
Record the quotient 7 as the next digit in the result. 
Result so far: 1025.38709677
If we take 217 away from 230, we end up 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.

In conclusion, the division gives 1025.38709677 with a balance of 1.3e-08.