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

On to step 1:
40 can be fit into 8 0 times, resulting in a remainder of 8.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we take 0 away from 8, we end up with 8.
Bring next digit (0) of the dividend behind the 8 and repeat the process: 80 / 40

On to step 2:
The number 40 fits into 80 2 times, leaving a remainder of 0.
Write down 2 as next digit of the result. 
Result so far: 2.0
If we take 80 away from 80, we end up with 0.
Grab the next digit (1) from the dividend, add it to 0, then carry on: 1 / 40

Step 3:
40 goes into 1 0 times with a remainder of 1.
Write down 0 as next digit of the result. 
Result so far: 20.0
Subtract 0 from 1 to get 1.
Bring next digit (1) of the dividend behind the 1 and repeat the process: 11 / 40

Moving on to step 4:
If we divide 11 by 40, we get 0 and a remainder of 11.
Put 0 as the next digit of the answer. 
Result so far: 200.0
The remainder is 11 after subtracting 0 from 11.
Append the next digit (4) from the dividend to 11 and continue with: 114 / 40

Moving on to step 5:
40 can be fit into 114 2 times, resulting in a remainder of 34.
The next digit of our result is 2. 
Result so far: 2002.0
Deduct 80 from 114 and we're left with 34.
Take the next digit (0) from the dividend and append it to 34, then repeat: 340 / 40

Going ahead to step 6:
40 goes into 340 8 times with a remainder of 20.
Use 8 as the next digit of our solution. 
Result so far: 20028.0
Deduct 320 from 340 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 7:
If we divide 200 by 40, we get 5 and a remainder of 0.
Put 5 as the next digit of the answer. 
Result so far: 20028.5
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.

Advancing to step 8:
When dividing 0 by 40, we get 0 with a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 20028.5
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.

Step 9:
If we divide 0 by 40, we get 0 and a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 20028.5
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 outcome is 20028.5, with a leftover of 0.0.