We look at the division of 586850 by 38 
The aim is to understand the frequency of 38 in 586850.

On to step 1:
38 can be fit into 5 0 times, resulting in a remainder of 5.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
The remainder is 5 after subtracting 0 from 5.
Include the next digit (8) from the dividend after 5, then repeat: 58 / 38

Going ahead to step 2:
When dividing 58 by 38, we get 1 with a remainder of 20.
Use 1 as the next digit of our solution. 
Result so far: 1.0
Deduct 38 from 58 and we're left with 20.
Bring next digit (6) of the dividend behind the 20 and repeat the process: 206 / 38

Going ahead to step 3:
38 can be fit into 206 5 times, resulting in a remainder of 16.
The number 5 becomes the next digit in our result. 
Result so far: 15.0
If we take 190 away from 206, we end up with 16.
Append the next digit (8) from the dividend to 16 and continue with: 168 / 38

Moving on to step 4:
If we divide 168 by 38, we get 4 and a remainder of 16.
The number 4 becomes the next digit in our result. 
Result so far: 154.0
The remainder is 16 after subtracting 152 from 168.
Take the next digit (5) from the dividend and append it to 16, then repeat: 165 / 38

On to step 5:
38 goes into 165 4 times with a remainder of 13.
Record the quotient 4 as the next digit in the result. 
Result so far: 1544.0
The remainder is 13 after subtracting 152 from 165.
Bring next digit (0) of the dividend behind the 13 and repeat the process: 130 / 38

Step 6:
When dividing 130 by 38, we get 3 with a remainder of 16.
Use 3 as the next digit of our solution. 
Result so far: 15443.0
Subtract 114 from 130 to get 16.
Since there are no more digits in the dividend, we add a zero to the remainder making it 160, and continue the process.

Step 7:
38 goes into 160 4 times with a remainder of 8.
Use 4 as the next digit of our solution. 
Result so far: 15443.4
Deduct 152 from 160 and we're left with 8.
Since there are no more digits in the dividend, we add a zero to the remainder making it 80, and continue the process.

Going ahead to step 8:
38 goes into 80 2 times with a remainder of 4.
The number 2 becomes the next digit in our result. 
Result so far: 15443.42
Subtract 76 from 80 to get 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

Going ahead to step 9:
The number 38 fits into 40 1 times, leaving a remainder of 2.
Record the quotient 1 as the next digit in the result. 
Result so far: 15443.421
If we subtract 38 from 40, we get 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

Step 10:
When dividing 20 by 38, we get 0 with a remainder of 20.
The number 0 becomes the next digit in our result. 
Result so far: 15443.421
If we take 0 away from 20, 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.

On to step 11:
The number 38 fits into 200 5 times, leaving a remainder of 10.
The next digit of our result is 5. 
Result so far: 15443.42105
Subtract 190 from 200 to get 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Moving on to step 12:
The number 38 fits into 100 2 times, leaving a remainder of 24.
Put 2 as the next digit of the answer. 
Result so far: 15443.421052
If we subtract 76 from 100, we get 24.
Since there are no more digits in the dividend, we add a zero to the remainder making it 240, and continue the process.

On to step 13:
If we divide 240 by 38, we get 6 and a remainder of 12.
Put 6 as the next digit of the answer. 
Result so far: 15443.4210526
Subtract 228 from 240 to get 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 14:
The number 38 fits into 120 3 times, leaving a remainder of 6.
Use 3 as the next digit of our solution. 
Result so far: 15443.42105263
Subtracting 114 from 120 leaves us with 6.
Since there are no more digits in the dividend, we add a zero to the remainder making it 60, and continue the process.

The final outcome is 15443.42105263, with a leftover of 6e-09.