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

Advancing to step 1:
The number 40 fits into 1 0 times, leaving a remainder of 1.
The next digit of our result is 0. 
Result so far: 0.0
Subtracting 0 from 1 leaves us with 1.
Bring next digit (5) of the dividend behind the 1 and repeat the process: 15 / 40

Step 2:
When dividing 15 by 40, we get 0 with a remainder of 15.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we subtract 0 from 15, we get 15.
Grab the next digit (8) from the dividend, add it to 15, then carry on: 158 / 40

Step 3:
When dividing 158 by 40, we get 3 with a remainder of 38.
The number 3 becomes the next digit in our result. 
Result so far: 3.0
Subtract 120 from 158 to get 38.
Append the next digit (4) from the dividend to 38 and continue with: 384 / 40

Let's proceed to step 4:
The number 40 fits into 384 9 times, leaving a remainder of 24.
The number 9 becomes the next digit in our result. 
Result so far: 39.0
If we subtract 360 from 384, we get 24.
Grab the next digit (7) from the dividend, add it to 24, then carry on: 247 / 40

Let's proceed to step 5:
40 can be fit into 247 6 times, resulting in a remainder of 7.
Record the quotient 6 as the next digit in the result. 
Result so far: 396.0
The remainder is 7 after subtracting 240 from 247.
Bring next digit (0) of the dividend behind the 7 and repeat the process: 70 / 40

On to step 6:
40 goes into 70 1 times with a remainder of 30.
Use 1 as the next digit of our solution. 
Result so far: 3961.0
Deduct 40 from 70 and we're left with 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

Let's proceed to step 7:
40 can be fit into 300 7 times, resulting in a remainder of 20.
Use 7 as the next digit of our solution. 
Result so far: 3961.7
Subtracting 280 from 300 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:
If we divide 200 by 40, we get 5 and a remainder of 0.
Use 5 as the next digit of our solution. 
Result so far: 3961.75
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.

On to 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: 3961.75
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.

Advancing to step 10:
40 goes into 0 0 times with a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 3961.75
Subtract 0 from 0 to 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 3961.75 with a remaining 0.0.