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

Step 1:
When dividing 9 by 40, we get 0 with a remainder of 9.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we take 0 away from 9, we end up with 9.
Take the next digit (4) from the dividend and append it to 9, then repeat: 94 / 40

On to step 2:
When dividing 94 by 40, we get 2 with a remainder of 14.
Record the quotient 2 as the next digit in the result. 
Result so far: 2.0
If we take 80 away from 94, we end up with 14.
Bring next digit (0) of the dividend behind the 14 and repeat the process: 140 / 40

Going ahead to step 3:
40 can be fit into 140 3 times, resulting in a remainder of 20.
The number 3 becomes the next digit in our result. 
Result so far: 23.0
If we take 120 away from 140, we end up with 20.
Fetch the next digit (7) from the dividend, attach it to 20 and continue: 207 / 40

Step 4:
When dividing 207 by 40, we get 5 with a remainder of 7.
The next digit of our result is 5. 
Result so far: 235.0
Deduct 200 from 207 and we're left with 7.
Append the next digit (6) from the dividend to 7 and continue with: 76 / 40

Advancing to step 5:
If we divide 76 by 40, we get 1 and a remainder of 36.
The next digit of our result is 1. 
Result so far: 2351.0
Deduct 40 from 76 and we're left with 36.
Take the next digit (4) from the dividend and append it to 36, then repeat: 364 / 40

Going ahead to step 6:
If we divide 364 by 40, we get 9 and a remainder of 4.
Put 9 as the next digit of the answer. 
Result so far: 23519.0
Subtract 360 from 364 to get 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

Moving on to step 7:
When dividing 40 by 40, we get 1 with a remainder of 0.
Put 1 as the next digit of the answer. 
Result so far: 23519.1
If we subtract 40 from 40, 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.

Advancing to step 8:
When dividing 0 by 40, we get 0 with a remainder of 0.
Record the quotient 0 as the next digit in the result. 
Result so far: 23519.1
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.

On to step 9:
If we divide 0 by 40, we get 0 and a remainder of 0.
The next digit of our result is 0. 
Result so far: 23519.1
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.

Our division results in 23519.1 with a remaining 0.0.