We're dividing 198391 by 40 
The aim is to understand the frequency of 40 in 198391.

Going ahead to step 1:
1 divided by 40 is 0 with a remainder of 1.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
Subtracting 0 from 1 leaves us with 1.
Append the next digit (9) from the dividend to 1 and continue with: 19 / 40

On to step 2:
40 can be fit into 19 0 times, resulting in a remainder of 19.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
Subtracting 0 from 19 leaves us with 19.
Bring next digit (8) of the dividend behind the 19 and repeat the process: 198 / 40

Moving on to step 3:
40 can be fit into 198 4 times, resulting in a remainder of 38.
Use 4 as the next digit of our solution. 
Result so far: 4.0
The remainder is 38 after subtracting 160 from 198.
Take the next digit (3) from the dividend and append it to 38, then repeat: 383 / 40

On to step 4:
40 can be fit into 383 9 times, resulting in a remainder of 23.
Use 9 as the next digit of our solution. 
Result so far: 49.0
Subtract 360 from 383 to get 23.
Append the next digit (9) from the dividend to 23 and continue with: 239 / 40

Going ahead to step 5:
The number 40 fits into 239 5 times, leaving a remainder of 39.
The next digit of our result is 5. 
Result so far: 495.0
The remainder is 39 after subtracting 200 from 239.
Bring next digit (1) of the dividend behind the 39 and repeat the process: 391 / 40

Advancing to step 6:
If we divide 391 by 40, we get 9 and a remainder of 31.
Write down 9 as next digit of the result. 
Result so far: 4959.0
Subtracting 360 from 391 leaves us with 31.
Since there are no more digits in the dividend, we add a zero to the remainder making it 310, and continue the process.

Let's proceed to step 7:
The number 40 fits into 310 7 times, leaving a remainder of 30.
Record the quotient 7 as the next digit in the result. 
Result so far: 4959.7
Subtracting 280 from 310 leaves us 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 8:
300 divided by 40 is 7 with a remainder of 20.
Write down 7 as next digit of the result. 
Result so far: 4959.77
The remainder is 20 after subtracting 280 from 300.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

The quotient of the division is 4959.77, and the remainder is 0.02.