We're dividing 640507 by 18 
The aim is to understand the frequency of 18 in 640507.

On to step 1:
When dividing 6 by 18, we get 0 with a remainder of 6.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
Subtract 0 from 6 to get 6.
Include the next digit (4) from the dividend after 6, then repeat: 64 / 18

On to step 2:
The number 18 fits into 64 3 times, leaving a remainder of 10.
The number 3 becomes the next digit in our result. 
Result so far: 3.0
Deduct 54 from 64 and we're left with 10.
Bring next digit (0) of the dividend behind the 10 and repeat the process: 100 / 18

Moving on to step 3:
The number 18 fits into 100 5 times, leaving a remainder of 10.
Record the quotient 5 as the next digit in the result. 
Result so far: 35.0
If we subtract 90 from 100, we get 10.
Bring next digit (5) of the dividend behind the 10 and repeat the process: 105 / 18

On to step 4:
When dividing 105 by 18, we get 5 with a remainder of 15.
Use 5 as the next digit of our solution. 
Result so far: 355.0
Subtracting 90 from 105 leaves us with 15.
Bring next digit (0) of the dividend behind the 15 and repeat the process: 150 / 18

On to step 5:
18 can be fit into 150 8 times, resulting in a remainder of 6.
Use 8 as the next digit of our solution. 
Result so far: 3558.0
If we subtract 144 from 150, we get 6.
Bring next digit (7) of the dividend behind the 6 and repeat the process: 67 / 18

Advancing to step 6:
When dividing 67 by 18, we get 3 with a remainder of 13.
The next digit of our result is 3. 
Result so far: 35583.0
If we subtract 54 from 67, we get 13.
Since there are no more digits in the dividend, we add a zero to the remainder making it 130, and continue the process.

Advancing to step 7:
The number 18 fits into 130 7 times, leaving a remainder of 4.
Write down 7 as next digit of the result. 
Result so far: 35583.7
If we take 126 away from 130, we end up 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.

On to step 8:
40 divided by 18 is 2 with a remainder of 4.
The number 2 becomes the next digit in our result. 
Result so far: 35583.72
If we subtract 36 from 40, 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.

Step 9:
40 divided by 18 is 2 with a remainder of 4.
Put 2 as the next digit of the answer. 
Result so far: 35583.722
If we subtract 36 from 40, 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.

The quotient of the division is 35583.722, and the remainder is 0.0004.