166087 ÷ 31 
The aim is to understand the frequency of 31 in 166087.

On to step 1:
31 can be fit into 1 0 times, resulting in a remainder of 1.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we take 0 away from 1, we end up with 1.
Fetch the next digit (6) from the dividend, attach it to 1 and continue: 16 / 31

On to step 2:
The number 31 fits into 16 0 times, leaving a remainder of 16.
The next digit of our result is 0. 
Result so far: 0.0
Subtracting 0 from 16 leaves us with 16.
Bring next digit (6) of the dividend behind the 16 and repeat the process: 166 / 31

Going ahead to step 3:
The number 31 fits into 166 5 times, leaving a remainder of 11.
The number 5 becomes the next digit in our result. 
Result so far: 5.0
Subtracting 155 from 166 leaves us with 11.
Append the next digit (0) from the dividend to 11 and continue with: 110 / 31

On to step 4:
31 goes into 110 3 times with a remainder of 17.
The number 3 becomes the next digit in our result. 
Result so far: 53.0
Deduct 93 from 110 and we're left with 17.
Grab the next digit (8) from the dividend, add it to 17, then carry on: 178 / 31

Moving on to step 5:
178 divided by 31 is 5 with a remainder of 23.
The next digit of our result is 5. 
Result so far: 535.0
If we subtract 155 from 178, we get 23.
Take the next digit (7) from the dividend and append it to 23, then repeat: 237 / 31

Going ahead to step 6:
31 can be fit into 237 7 times, resulting in a remainder of 20.
Use 7 as the next digit of our solution. 
Result so far: 5357.0
If we take 217 away from 237, we end up with 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Advancing to step 7:
The number 31 fits into 200 6 times, leaving a remainder of 14.
Use 6 as the next digit of our solution. 
Result so far: 5357.6
If we subtract 186 from 200, we get 14.
Since there are no more digits in the dividend, we add a zero to the remainder making it 140, and continue the process.

Step 8:
The number 31 fits into 140 4 times, leaving a remainder of 16.
Use 4 as the next digit of our solution. 
Result so far: 5357.64
Subtracting 124 from 140 leaves us with 16.
Since there are no more digits in the dividend, we add a zero to the remainder making it 160, and continue the process.

Going ahead to step 9:
When dividing 160 by 31, we get 5 with a remainder of 5.
Put 5 as the next digit of the answer. 
Result so far: 5357.645
If we subtract 155 from 160, we get 5.
Since there are no more digits in the dividend, we add a zero to the remainder making it 50, and continue the process.

Going ahead to step 10:
When dividing 50 by 31, we get 1 with a remainder of 19.
Put 1 as the next digit of the answer. 
Result so far: 5357.6451
Subtract 31 from 50 to get 19.
Since there are no more digits in the dividend, we add a zero to the remainder making it 190, and continue the process.

Let's proceed to step 11:
190 divided by 31 is 6 with a remainder of 4.
Write down 6 as next digit of the result. 
Result so far: 5357.64516
Subtracting 186 from 190 leaves us with 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

Let's proceed to step 12:
31 goes into 40 1 times with a remainder of 9.
Write down 1 as next digit of the result. 
Result so far: 5357.645161
Subtract 31 from 40 to get 9.
Since there are no more digits in the dividend, we add a zero to the remainder making it 90, and continue the process.

Let's proceed to step 13:
31 can be fit into 90 2 times, resulting in a remainder of 28.
The next digit of our result is 2. 
Result so far: 5357.6451612
If we subtract 62 from 90, we get 28.
Since there are no more digits in the dividend, we add a zero to the remainder making it 280, and continue the process.

On to step 14:
280 divided by 31 is 9 with a remainder of 1.
Write down 9 as next digit of the result. 
Result so far: 5357.64516129
Subtract 279 from 280 to get 1.
Since there are no more digits in the dividend, we add a zero to the remainder making it 10, and continue the process.

The final outcome is 5357.64516129, with a leftover of 1e-09.