We divide 989178 by 40
The aim is to understand the frequency of 40 in 989178.

Let's proceed to step 1:
40 goes into 9 0 times with a remainder of 9.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
The remainder is 9 after subtracting 0 from 9.
Include the next digit (8) from the dividend after 9, then repeat: 98 / 40

On to step 2:
40 can be fit into 98 2 times, resulting in a remainder of 18.
Use 2 as the next digit of our solution. 
Result so far: 2.0
The remainder is 18 after subtracting 80 from 98.
Bring next digit (9) of the dividend behind the 18 and repeat the process: 189 / 40

Moving on to step 3:
40 can be fit into 189 4 times, resulting in a remainder of 29.
Record the quotient 4 as the next digit in the result. 
Result so far: 24.0
Subtracting 160 from 189 leaves us with 29.
Take the next digit (1) from the dividend and append it to 29, then repeat: 291 / 40

On to step 4:
40 goes into 291 7 times with a remainder of 11.
Put 7 as the next digit of the answer. 
Result so far: 247.0
The remainder is 11 after subtracting 280 from 291.
Fetch the next digit (7) from the dividend, attach it to 11 and continue: 117 / 40

Step 5:
If we divide 117 by 40, we get 2 and a remainder of 37.
Record the quotient 2 as the next digit in the result. 
Result so far: 2472.0
Deduct 80 from 117 and we're left with 37.
Take the next digit (8) from the dividend and append it to 37, then repeat: 378 / 40

Going ahead to step 6:
40 can be fit into 378 9 times, resulting in a remainder of 18.
Use 9 as the next digit of our solution. 
Result so far: 24729.0
Subtract 360 from 378 to 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.

Going ahead to step 7:
If we divide 180 by 40, we get 4 and a remainder of 20.
Use 4 as the next digit of our solution. 
Result so far: 24729.4
If we take 160 away from 180, we end up 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.

On to step 8:
200 divided by 40 is 5 with a remainder of 0.
Use 5 as the next digit of our solution. 
Result so far: 24729.45
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 9:
0 divided by 40 is 0 with a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 24729.45
The remainder is 0 after subtracting 0 from 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Going ahead to step 10:
When dividing 0 by 40, we get 0 with a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 24729.45
Subtract 0 from 0 to 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.

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