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

Going ahead to step 1:
3 divided by 38 is 0 with a remainder of 3.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we take 0 away from 3, we end up with 3.
Take the next digit (9) from the dividend and append it to 3, then repeat: 39 / 38

Going ahead to step 2:
38 goes into 39 1 times with a remainder of 1.
Record the quotient 1 as the next digit in the result. 
Result so far: 1.0
Subtract 38 from 39 to get 1.
Take the next digit (9) from the dividend and append it to 1, then repeat: 19 / 38

Advancing to step 3:
If we divide 19 by 38, we get 0 and a remainder of 19.
Use 0 as the next digit of our solution. 
Result so far: 10.0
Subtracting 0 from 19 leaves us with 19.
Fetch the next digit (7) from the dividend, attach it to 19 and continue: 197 / 38

Step 4:
The number 38 fits into 197 5 times, leaving a remainder of 7.
The number 5 becomes the next digit in our result. 
Result so far: 105.0
Deduct 190 from 197 and we're left with 7.
Grab the next digit (8) from the dividend, add it to 7, then carry on: 78 / 38

Advancing to step 5:
When dividing 78 by 38, we get 2 with a remainder of 2.
Use 2 as the next digit of our solution. 
Result so far: 1052.0
If we take 76 away from 78, we end up with 2.
Take the next digit (2) from the dividend and append it to 2, then repeat: 22 / 38

Let's proceed to step 6:
38 goes into 22 0 times with a remainder of 22.
Record the quotient 0 as the next digit in the result. 
Result so far: 10520.0
If we subtract 0 from 22, we 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.

Advancing to step 7:
The number 38 fits into 220 5 times, leaving a remainder of 30.
Write down 5 as next digit of the result. 
Result so far: 10520.5
The remainder is 30 after subtracting 190 from 220.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

Going ahead to step 8:
300 divided by 38 is 7 with a remainder of 34.
Put 7 as the next digit of the answer. 
Result so far: 10520.57
Deduct 266 from 300 and we're left with 34.
Since there are no more digits in the dividend, we add a zero to the remainder making it 340, and continue the process.

Going ahead to step 9:
38 can be fit into 340 8 times, resulting in a remainder of 36.
The number 8 becomes the next digit in our result. 
Result so far: 10520.578
If we subtract 304 from 340, we get 36.
Since there are no more digits in the dividend, we add a zero to the remainder making it 360, and continue the process.

Advancing to step 10:
38 goes into 360 9 times with a remainder of 18.
Use 9 as the next digit of our solution. 
Result so far: 10520.5789
If we subtract 342 from 360, we get 18.
Since there are no more digits in the dividend, we add a zero to the remainder making it 180, and continue the process.

Moving on to step 11:
38 can be fit into 180 4 times, resulting in a remainder of 28.
Write down 4 as next digit of the result. 
Result so far: 10520.57894
The remainder is 28 after subtracting 152 from 180.
Since there are no more digits in the dividend, we add a zero to the remainder making it 280, and continue the process.

Moving on to step 12:
38 goes into 280 7 times with a remainder of 14.
Put 7 as the next digit of the answer. 
Result so far: 10520.578947
Deduct 266 from 280 and we're left with 14.
Since there are no more digits in the dividend, we add a zero to the remainder making it 140, and continue the process.

On to step 13:
If we divide 140 by 38, we get 3 and a remainder of 26.
Record the quotient 3 as the next digit in the result. 
Result so far: 10520.5789473
If we subtract 114 from 140, 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.

On to step 14:
38 can be fit into 260 6 times, resulting in a remainder of 32.
Put 6 as the next digit of the answer. 
Result so far: 10520.57894736
If we take 228 away from 260, we end up with 32.
Since there are no more digits in the dividend, we add a zero to the remainder making it 320, and continue the process.

The final result is 10520.57894736 with a remainder of 3.2e-08.