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

Going ahead to step 1:
When dividing 4 by 40, we get 0 with a remainder of 4.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we take 0 away from 4, we end up with 4.
Include the next digit (8) from the dividend after 4, then repeat: 48 / 40

Let's proceed to step 2:
40 goes into 48 1 times with a remainder of 8.
Record the quotient 1 as the next digit in the result. 
Result so far: 1.0
The remainder is 8 after subtracting 40 from 48.
Grab the next digit (7) from the dividend, add it to 8, then carry on: 87 / 40

Going ahead to step 3:
If we divide 87 by 40, we get 2 and a remainder of 7.
The next digit of our result is 2. 
Result so far: 12.0
Deduct 80 from 87 and we're left with 7.
Fetch the next digit (9) from the dividend, attach it to 7 and continue: 79 / 40

Step 4:
40 goes into 79 1 times with a remainder of 39.
Write down 1 as next digit of the result. 
Result so far: 121.0
Deduct 40 from 79 and we're left with 39.
Take the next digit (8) from the dividend and append it to 39, then repeat: 398 / 40

Going ahead to step 5:
The number 40 fits into 398 9 times, leaving a remainder of 38.
The next digit of our result is 9. 
Result so far: 1219.0
If we subtract 360 from 398, we get 38.
Bring next digit (5) of the dividend behind the 38 and repeat the process: 385 / 40

Advancing to step 6:
40 goes into 385 9 times with a remainder of 25.
Use 9 as the next digit of our solution. 
Result so far: 12199.0
If we take 360 away from 385, we end up with 25.
Since there are no more digits in the dividend, we add a zero to the remainder making it 250, and continue the process.

On to step 7:
When dividing 250 by 40, we get 6 with a remainder of 10.
Use 6 as the next digit of our solution. 
Result so far: 12199.6
If we take 240 away from 250, we end up with 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Going ahead to step 8:
When dividing 100 by 40, we get 2 with a remainder of 20.
Put 2 as the next digit of the answer. 
Result so far: 12199.62
Subtract 80 from 100 to get 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:
When dividing 200 by 40, we get 5 with a remainder of 0.
The next digit of our result is 5. 
Result so far: 12199.625
If we subtract 200 from 200, 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.

Moving on to step 10:
When dividing 0 by 40, we get 0 with a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 12199.625
Deduct 0 from 0 and we're left 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:
40 can be fit into 0 0 times, resulting in a remainder of 0.
Record the quotient 0 as the next digit in the result. 
Result so far: 12199.625
If we take 0 away from 0, 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.

After the division, we end up with 12199.625 and a remainder of 0.0.