We look at the division of 587065 by 18 
The aim is to understand the frequency of 18 in 587065.

On to step 1:
The number 18 fits into 5 0 times, leaving a remainder of 5.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we take 0 away from 5, we end up with 5.
Append the next digit (8) from the dividend to 5 and continue with: 58 / 18

Step 2:
18 can be fit into 58 3 times, resulting in a remainder of 4.
Use 3 as the next digit of our solution. 
Result so far: 3.0
If we subtract 54 from 58, we get 4.
Bring next digit (7) of the dividend behind the 4 and repeat the process: 47 / 18

Advancing to step 3:
The number 18 fits into 47 2 times, leaving a remainder of 11.
The number 2 becomes the next digit in our result. 
Result so far: 32.0
Deduct 36 from 47 and we're left with 11.
Take the next digit (0) from the dividend and append it to 11, then repeat: 110 / 18

Going ahead to step 4:
If we divide 110 by 18, we get 6 and a remainder of 2.
Use 6 as the next digit of our solution. 
Result so far: 326.0
Deduct 108 from 110 and we're left with 2.
Grab the next digit (6) from the dividend, add it to 2, then carry on: 26 / 18

On to step 5:
18 goes into 26 1 times with a remainder of 8.
The next digit of our result is 1. 
Result so far: 3261.0
Subtracting 18 from 26 leaves us with 8.
Grab the next digit (5) from the dividend, add it to 8, then carry on: 85 / 18

Advancing to step 6:
When dividing 85 by 18, we get 4 with a remainder of 13.
Record the quotient 4 as the next digit in the result. 
Result so far: 32614.0
If we take 72 away from 85, we end up with 13.
Since there are no more digits in the dividend, we add a zero to the remainder making it 130, and continue the process.

Going ahead to step 7:
18 can be fit into 130 7 times, resulting in a remainder of 4.
The next digit of our result is 7. 
Result so far: 32614.7
If we subtract 126 from 130, we get 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

Going ahead to step 8:
If we divide 40 by 18, we get 2 and a remainder of 4.
Put 2 as the next digit of the answer. 
Result so far: 32614.72
Subtracting 36 from 40 leaves us with 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

Step 9:
18 goes into 40 2 times with a remainder of 4.
Write down 2 as next digit of the result. 
Result so far: 32614.722
Subtract 36 from 40 to get 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

After the division, we end up with 32614.722 and a remainder of 0.0004.