We look at the division of 996621 by 40 
The aim is to understand the frequency of 40 in 996621.

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

Step 2:
If we divide 99 by 40, we get 2 and a remainder of 19.
Use 2 as the next digit of our solution. 
Result so far: 2.0
If we take 80 away from 99, we end up with 19.
Append the next digit (6) from the dividend to 19 and continue with: 196 / 40

Advancing to step 3:
When dividing 196 by 40, we get 4 with a remainder of 36.
The number 4 becomes the next digit in our result. 
Result so far: 24.0
If we take 160 away from 196, we end up with 36.
Fetch the next digit (6) from the dividend, attach it to 36 and continue: 366 / 40

Step 4:
366 divided by 40 is 9 with a remainder of 6.
The next digit of our result is 9. 
Result so far: 249.0
Subtracting 360 from 366 leaves us with 6.
Fetch the next digit (2) from the dividend, attach it to 6 and continue: 62 / 40

Going ahead to step 5:
If we divide 62 by 40, we get 1 and a remainder of 22.
Use 1 as the next digit of our solution. 
Result so far: 2491.0
Deduct 40 from 62 and we're left with 22.
Grab the next digit (1) from the dividend, add it to 22, then carry on: 221 / 40

Moving on to step 6:
221 divided by 40 is 5 with a remainder of 21.
Record the quotient 5 as the next digit in the result. 
Result so far: 24915.0
Subtract 200 from 221 to get 21.
Since there are no more digits in the dividend, we add a zero to the remainder making it 210, and continue the process.

Advancing to step 7:
40 can be fit into 210 5 times, resulting in a remainder of 10.
Write down 5 as next digit of the result. 
Result so far: 24915.5
Subtract 200 from 210 to get 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Moving on to step 8:
If we divide 100 by 40, we get 2 and a remainder of 20.
The next digit of our result is 2. 
Result so far: 24915.52
Deduct 80 from 100 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:
The number 40 fits into 200 5 times, leaving a remainder of 0.
The next digit of our result is 5. 
Result so far: 24915.525
Deduct 200 from 200 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.

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: 24915.525
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.

Step 11:
0 divided by 40 is 0 with a remainder of 0.
The next digit of our result is 0. 
Result so far: 24915.525
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.

The final result is 24915.525 with a remainder of 0.0.