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

Let's proceed to step 1:
40 goes into 4 0 times with a remainder of 4.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we take 0 away from 4, we end up with 4.
Bring next digit (0) of the dividend behind the 4 and repeat the process: 40 / 40

Moving on to step 2:
40 divided by 40 is 1 with a remainder of 0.
The next digit of our result is 1. 
Result so far: 1.0
If we subtract 40 from 40, we get 0.
Include the next digit (2) from the dividend after 0, then repeat: 2 / 40

Advancing to step 3:
The number 40 fits into 2 0 times, leaving a remainder of 2.
Put 0 as the next digit of the answer. 
Result so far: 10.0
Deduct 0 from 2 and we're left with 2.
Fetch the next digit (5) from the dividend, attach it to 2 and continue: 25 / 40

Step 4:
25 divided by 40 is 0 with a remainder of 25.
Use 0 as the next digit of our solution. 
Result so far: 100.0
Subtracting 0 from 25 leaves us with 25.
Take the next digit (4) from the dividend and append it to 25, then repeat: 254 / 40

On to step 5:
The number 40 fits into 254 6 times, leaving a remainder of 14.
Record the quotient 6 as the next digit in the result. 
Result so far: 1006.0
Subtracting 240 from 254 leaves us with 14.
Fetch the next digit (1) from the dividend, attach it to 14 and continue: 141 / 40

Advancing to step 6:
40 goes into 141 3 times with a remainder of 21.
The number 3 becomes the next digit in our result. 
Result so far: 10063.0
If we take 120 away from 141, we end up with 21.
Since there are no more digits in the dividend, we add a zero to the remainder making it 210, and continue the process.

Let's proceed to step 7:
210 divided by 40 is 5 with a remainder of 10.
Use 5 as the next digit of our solution. 
Result so far: 10063.5
If we take 200 away from 210, 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.

Advancing to step 8:
The number 40 fits into 100 2 times, leaving a remainder of 20.
Write down 2 as next digit of the result. 
Result so far: 10063.52
Subtracting 80 from 100 leaves us 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.

Let's proceed to step 9:
40 goes into 200 5 times with a remainder of 0.
The next digit of our result is 5. 
Result so far: 10063.525
The remainder is 0 after subtracting 200 from 200.
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:
The number 40 fits into 0 0 times, leaving a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 10063.525
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.

On to step 11:
40 can be fit into 0 0 times, resulting in a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 10063.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.

Our division results in 10063.525 with a remaining 0.0.