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

On to step 1:
The number 38 fits into 5 0 times, leaving a remainder of 5.
Use 0 as the next digit of our solution. 
Result so far: 0.0
Subtract 0 from 5 to get 5.
Bring next digit (0) of the dividend behind the 5 and repeat the process: 50 / 38

Advancing to step 2:
When dividing 50 by 38, we get 1 with a remainder of 12.
Put 1 as the next digit of the answer. 
Result so far: 1.0
The remainder is 12 after subtracting 38 from 50.
Include the next digit (0) from the dividend after 12, then repeat: 120 / 38

Going ahead to step 3:
38 can be fit into 120 3 times, resulting in a remainder of 6.
The next digit of our result is 3. 
Result so far: 13.0
If we subtract 114 from 120, we get 6.
Take the next digit (9) from the dividend and append it to 6, then repeat: 69 / 38

Step 4:
When dividing 69 by 38, we get 1 with a remainder of 31.
Record the quotient 1 as the next digit in the result. 
Result so far: 131.0
The remainder is 31 after subtracting 38 from 69.
Include the next digit (9) from the dividend after 31, then repeat: 319 / 38

Going ahead to step 5:
If we divide 319 by 38, we get 8 and a remainder of 15.
Record the quotient 8 as the next digit in the result. 
Result so far: 1318.0
The remainder is 15 after subtracting 304 from 319.
Grab the next digit (6) from the dividend, add it to 15, then carry on: 156 / 38

Going ahead to step 6:
The number 38 fits into 156 4 times, leaving a remainder of 4.
The next digit of our result is 4. 
Result so far: 13184.0
Deduct 152 from 156 and we're left 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.

Step 7:
40 divided by 38 is 1 with a remainder of 2.
Use 1 as the next digit of our solution. 
Result so far: 13184.1
If we take 38 away from 40, we end up with 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

Going ahead to step 8:
38 goes into 20 0 times with a remainder of 20.
Use 0 as the next digit of our solution. 
Result so far: 13184.1
Deduct 0 from 20 and we're left 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 9:
38 goes into 200 5 times with a remainder of 10.
The number 5 becomes the next digit in our result. 
Result so far: 13184.105
If we subtract 190 from 200, we 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.

Advancing to step 10:
38 goes into 100 2 times with a remainder of 24.
Put 2 as the next digit of the answer. 
Result so far: 13184.1052
The remainder is 24 after subtracting 76 from 100.
Since there are no more digits in the dividend, we add a zero to the remainder making it 240, and continue the process.

Step 11:
When dividing 240 by 38, we get 6 with a remainder of 12.
The next digit of our result is 6. 
Result so far: 13184.10526
If we take 228 away from 240, we end up 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 12:
If we divide 120 by 38, we get 3 and a remainder of 6.
Use 3 as the next digit of our solution. 
Result so far: 13184.105263
If we take 114 away from 120, we end up 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.

Step 13:
The number 38 fits into 60 1 times, leaving a remainder of 22.
The number 1 becomes the next digit in our result. 
Result so far: 13184.1052631
Subtract 38 from 60 to get 22.
Since there are no more digits in the dividend, we add a zero to the remainder making it 220, and continue the process.

Moving on to step 14:
If we divide 220 by 38, we get 5 and a remainder of 30.
The next digit of our result is 5. 
Result so far: 13184.10526315
If we take 190 away from 220, we end up 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.

The final outcome is 13184.10526315, with a leftover of 3e-08.