399775 divided by 40 
The aim is to understand the frequency of 40 in 399775.

Step 1:
40 can be fit into 3 0 times, resulting in a remainder of 3.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we subtract 0 from 3, we get 3.
Include the next digit (9) from the dividend after 3, then repeat: 39 / 40

On to step 2:
40 can be fit into 39 0 times, resulting in a remainder of 39.
Put 0 as the next digit of the answer. 
Result so far: 0.0
The remainder is 39 after subtracting 0 from 39.
Append the next digit (9) from the dividend to 39 and continue with: 399 / 40

On to step 3:
40 can be fit into 399 9 times, resulting in a remainder of 39.
The number 9 becomes the next digit in our result. 
Result so far: 9.0
If we subtract 360 from 399, we get 39.
Fetch the next digit (7) from the dividend, attach it to 39 and continue: 397 / 40

Moving on to step 4:
The number 40 fits into 397 9 times, leaving a remainder of 37.
The next digit of our result is 9. 
Result so far: 99.0
If we take 360 away from 397, we end up with 37.
Append the next digit (7) from the dividend to 37 and continue with: 377 / 40

Going ahead to step 5:
40 can be fit into 377 9 times, resulting in a remainder of 17.
Put 9 as the next digit of the answer. 
Result so far: 999.0
If we subtract 360 from 377, we get 17.
Grab the next digit (5) from the dividend, add it to 17, then carry on: 175 / 40

On to step 6:
40 can be fit into 175 4 times, resulting in a remainder of 15.
Write down 4 as next digit of the result. 
Result so far: 9994.0
If we subtract 160 from 175, we get 15.
Since there are no more digits in the dividend, we add a zero to the remainder making it 150, and continue the process.

Going ahead to step 7:
When dividing 150 by 40, we get 3 with a remainder of 30.
The number 3 becomes the next digit in our result. 
Result so far: 9994.3
Deduct 120 from 150 and we're left 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.

Going ahead to step 8:
40 goes into 300 7 times with a remainder of 20.
The number 7 becomes the next digit in our result. 
Result so far: 9994.37
Deduct 280 from 300 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.

Step 9:
200 divided by 40 is 5 with a remainder of 0.
The next digit of our result is 5. 
Result so far: 9994.375
If we take 200 away from 200, we end up with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

On to step 10:
40 can be fit into 0 0 times, resulting in a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 9994.375
Subtracting 0 from 0 leaves us with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

On to step 11:
The number 40 fits into 0 0 times, leaving a remainder of 0.
The next digit of our result is 0. 
Result so far: 9994.375
If we subtract 0 from 0, we get 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Our division results in 9994.375 with a remaining 0.0.