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

Step 1:
When dividing 3 by 40, we get 0 with a remainder of 3.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
Deduct 0 from 3 and we're left with 3.
Include the next digit (6) from the dividend after 3, then repeat: 36 / 40

On to step 2:
40 goes into 36 0 times with a remainder of 36.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 36 after subtracting 0 from 36.
Grab the next digit (6) from the dividend, add it to 36, then carry on: 366 / 40

Going ahead to step 3:
If we divide 366 by 40, we get 9 and a remainder of 6.
Record the quotient 9 as the next digit in the result. 
Result so far: 9.0
The remainder is 6 after subtracting 360 from 366.
Grab the next digit (2) from the dividend, add it to 6, then carry on: 62 / 40

Moving on to step 4:
The number 40 fits into 62 1 times, leaving a remainder of 22.
Write down 1 as next digit of the result. 
Result so far: 91.0
Subtract 40 from 62 to get 22.
Bring next digit (5) of the dividend behind the 22 and repeat the process: 225 / 40

Going ahead to step 5:
40 goes into 225 5 times with a remainder of 25.
Record the quotient 5 as the next digit in the result. 
Result so far: 915.0
Subtract 200 from 225 to get 25.
Grab the next digit (8) from the dividend, add it to 25, then carry on: 258 / 40

On to step 6:
When dividing 258 by 40, we get 6 with a remainder of 18.
Use 6 as the next digit of our solution. 
Result so far: 9156.0
Subtracting 240 from 258 leaves us with 18.
Since there are no more digits in the dividend, we add a zero to the remainder making it 180, and continue the process.

Let's proceed to step 7:
40 can be fit into 180 4 times, resulting in a remainder of 20.
The next digit of our result is 4. 
Result so far: 9156.4
Subtracting 160 from 180 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.

Step 8:
40 goes into 200 5 times with a remainder of 0.
The number 5 becomes the next digit in our result. 
Result so far: 9156.45
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.

Step 9:
0 divided by 40 is 0 with a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 9156.45
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.

Advancing to step 10:
40 can be fit into 0 0 times, resulting in a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 9156.45
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.

Our division results in 9156.45 with a remaining 0.0.