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

Let's proceed to step 1:
1 divided by 31 is 0 with a remainder of 1.
Write down 0 as next digit of the result. 
Result so far: 0.0
Deduct 0 from 1 and we're left with 1.
Bring next digit (5) of the dividend behind the 1 and repeat the process: 15 / 31

Advancing to step 2:
31 goes into 15 0 times with a remainder of 15.
The next digit of our result is 0. 
Result so far: 0.0
The remainder is 15 after subtracting 0 from 15.
Grab the next digit (8) from the dividend, add it to 15, then carry on: 158 / 31

Let's proceed to step 3:
31 can be fit into 158 5 times, resulting in a remainder of 3.
Put 5 as the next digit of the answer. 
Result so far: 5.0
Subtract 155 from 158 to get 3.
Grab the next digit (1) from the dividend, add it to 3, then carry on: 31 / 31

Moving on to step 4:
31 goes into 31 1 times with a remainder of 0.
The next digit of our result is 1. 
Result so far: 51.0
Subtract 31 from 31 to get 0.
Fetch the next digit (7) from the dividend, attach it to 0 and continue: 7 / 31

Going ahead to step 5:
31 goes into 7 0 times with a remainder of 7.
Use 0 as the next digit of our solution. 
Result so far: 510.0
The remainder is 7 after subtracting 0 from 7.
Include the next digit (9) from the dividend after 7, then repeat: 79 / 31

Step 6:
If we divide 79 by 31, we get 2 and a remainder of 17.
Put 2 as the next digit of the answer. 
Result so far: 5102.0
Subtracting 62 from 79 leaves us 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.

On to step 7:
31 can be fit into 170 5 times, resulting in a remainder of 15.
Use 5 as the next digit of our solution. 
Result so far: 5102.5
Subtract 155 from 170 to get 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 8:
When dividing 150 by 31, we get 4 with a remainder of 26.
Record the quotient 4 as the next digit in the result. 
Result so far: 5102.54
If we subtract 124 from 150, we get 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 9:
31 can be fit into 260 8 times, resulting in a remainder of 12.
Record the quotient 8 as the next digit in the result. 
Result so far: 5102.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.

On to step 10:
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: 5102.5483
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.

Step 11:
270 divided by 31 is 8 with a remainder of 22.
The number 8 becomes the next digit in our result. 
Result so far: 5102.54838
If we take 248 away from 270, we end up 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.

Step 12:
220 divided by 31 is 7 with a remainder of 3.
Put 7 as the next digit of the answer. 
Result so far: 5102.548387
If we subtract 217 from 220, we 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.

Going ahead to step 13:
The number 31 fits into 30 0 times, leaving a remainder of 30.
Record the quotient 0 as the next digit in the result. 
Result so far: 5102.548387
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.

Step 14:
300 divided by 31 is 9 with a remainder of 21.
The number 9 becomes the next digit in our result. 
Result so far: 5102.54838709
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.

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