We look at the division of 377159 by 31 
The aim is to understand the frequency of 31 in 377159.

Advancing to step 1:
If we divide 3 by 31, we get 0 and a remainder of 3.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 3 after subtracting 0 from 3.
Fetch the next digit (7) from the dividend, attach it to 3 and continue: 37 / 31

Going ahead to step 2:
If we divide 37 by 31, we get 1 and a remainder of 6.
Write down 1 as next digit of the result. 
Result so far: 1.0
Deduct 31 from 37 and we're left with 6.
Append the next digit (7) from the dividend to 6 and continue with: 67 / 31

Let's proceed to step 3:
67 divided by 31 is 2 with a remainder of 5.
Use 2 as the next digit of our solution. 
Result so far: 12.0
Deduct 62 from 67 and we're left with 5.
Bring next digit (1) of the dividend behind the 5 and repeat the process: 51 / 31

Let's proceed to step 4:
31 goes into 51 1 times with a remainder of 20.
Write down 1 as next digit of the result. 
Result so far: 121.0
Deduct 31 from 51 and we're left with 20.
Take the next digit (5) from the dividend and append it to 20, then repeat: 205 / 31

Moving on to step 5:
31 goes into 205 6 times with a remainder of 19.
The next digit of our result is 6. 
Result so far: 1216.0
Deduct 186 from 205 and we're left with 19.
Append the next digit (9) from the dividend to 19 and continue with: 199 / 31

Advancing to step 6:
When dividing 199 by 31, we get 6 with a remainder of 13.
Put 6 as the next digit of the answer. 
Result so far: 12166.0
If we subtract 186 from 199, we 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.

Moving on to step 7:
If we divide 130 by 31, we get 4 and a remainder of 6.
The next digit of our result is 4. 
Result so far: 12166.4
The remainder is 6 after subtracting 124 from 130.
Since there are no more digits in the dividend, we add a zero to the remainder making it 60, and continue the process.

Going ahead to step 8:
The number 31 fits into 60 1 times, leaving a remainder of 29.
The number 1 becomes the next digit in our result. 
Result so far: 12166.41
If we take 31 away from 60, we end up with 29.
Since there are no more digits in the dividend, we add a zero to the remainder making it 290, and continue the process.

On to step 9:
When dividing 290 by 31, we get 9 with a remainder of 11.
Put 9 as the next digit of the answer. 
Result so far: 12166.419
Deduct 279 from 290 and we're left with 11.
Since there are no more digits in the dividend, we add a zero to the remainder making it 110, and continue the process.

On to step 10:
110 divided by 31 is 3 with a remainder of 17.
Record the quotient 3 as the next digit in the result. 
Result so far: 12166.4193
If we take 93 away from 110, we end up 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.

Let's proceed to step 11:
31 goes into 170 5 times with a remainder of 15.
Write down 5 as next digit of the result. 
Result so far: 12166.41935
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.

Step 12:
31 can be fit into 150 4 times, resulting in a remainder of 26.
The number 4 becomes the next digit in our result. 
Result so far: 12166.419354
If we take 124 away from 150, we end up with 26.
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 13:
260 divided by 31 is 8 with a remainder of 12.
Record the quotient 8 as the next digit in the result. 
Result so far: 12166.4193548
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.

Let's proceed to step 14:
120 divided by 31 is 3 with a remainder of 27.
Use 3 as the next digit of our solution. 
Result so far: 12166.41935483
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.

The final result is 12166.41935483 with a remainder of 2.7e-08.