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

Let's proceed to step 1:
40 can be fit into 8 0 times, resulting in a remainder of 8.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we subtract 0 from 8, we get 8.
Append the next digit (6) from the dividend to 8 and continue with: 86 / 40

Going ahead to step 2:
40 can be fit into 86 2 times, resulting in a remainder of 6.
Put 2 as the next digit of the answer. 
Result so far: 2.0
Deduct 80 from 86 and we're left with 6.
Bring next digit (1) of the dividend behind the 6 and repeat the process: 61 / 40

Going ahead to step 3:
When dividing 61 by 40, we get 1 with a remainder of 21.
Use 1 as the next digit of our solution. 
Result so far: 21.0
If we take 40 away from 61, we end up with 21.
Bring next digit (7) of the dividend behind the 21 and repeat the process: 217 / 40

Going ahead to step 4:
When dividing 217 by 40, we get 5 with a remainder of 17.
The next digit of our result is 5. 
Result so far: 215.0
The remainder is 17 after subtracting 200 from 217.
Append the next digit (3) from the dividend to 17 and continue with: 173 / 40

On to step 5:
When dividing 173 by 40, we get 4 with a remainder of 13.
Write down 4 as next digit of the result. 
Result so far: 2154.0
If we subtract 160 from 173, we get 13.
Append the next digit (0) from the dividend to 13 and continue with: 130 / 40

Step 6:
If we divide 130 by 40, we get 3 and a remainder of 10.
Record the quotient 3 as the next digit in the result. 
Result so far: 21543.0
The remainder is 10 after subtracting 120 from 130.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Let's proceed to step 7:
40 goes into 100 2 times with a remainder of 20.
Put 2 as the next digit of the answer. 
Result so far: 21543.2
If we subtract 80 from 100, we get 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Moving on to step 8:
40 can be fit into 200 5 times, resulting in a remainder of 0.
The number 5 becomes the next digit in our result. 
Result so far: 21543.25
If we take 200 away from 200, 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.

Going ahead to step 9:
40 can be fit into 0 0 times, resulting in a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 21543.25
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.

Moving on to step 10:
40 goes into 0 0 times with a remainder of 0.
Record the quotient 0 as the next digit in the result. 
Result so far: 21543.25
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.

After the division, we end up with 21543.25 and a remainder of 0.0.