505161 ÷ 18 
The aim is to understand the frequency of 18 in 505161.

Let's proceed to step 1:
The number 18 fits into 5 0 times, leaving a remainder of 5.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we subtract 0 from 5, we get 5.
Take the next digit (0) from the dividend and append it to 5, then repeat: 50 / 18

Going ahead to step 2:
If we divide 50 by 18, we get 2 and a remainder of 14.
Use 2 as the next digit of our solution. 
Result so far: 2.0
If we take 36 away from 50, we end up with 14.
Bring next digit (5) of the dividend behind the 14 and repeat the process: 145 / 18

On to step 3:
18 can be fit into 145 8 times, resulting in a remainder of 1.
Write down 8 as next digit of the result. 
Result so far: 28.0
Subtracting 144 from 145 leaves us with 1.
Fetch the next digit (1) from the dividend, attach it to 1 and continue: 11 / 18

Let's proceed to step 4:
18 can be fit into 11 0 times, resulting in a remainder of 11.
Put 0 as the next digit of the answer. 
Result so far: 280.0
Subtract 0 from 11 to get 11.
Bring next digit (6) of the dividend behind the 11 and repeat the process: 116 / 18

Moving on to step 5:
18 goes into 116 6 times with a remainder of 8.
Put 6 as the next digit of the answer. 
Result so far: 2806.0
If we take 108 away from 116, we end up with 8.
Include the next digit (1) from the dividend after 8, then repeat: 81 / 18

Moving on to step 6:
18 goes into 81 4 times with a remainder of 9.
Record the quotient 4 as the next digit in the result. 
Result so far: 28064.0
Subtract 72 from 81 to get 9.
Since there are no more digits in the dividend, we add a zero to the remainder making it 90, and continue the process.

Step 7:
90 divided by 18 is 5 with a remainder of 0.
The number 5 becomes the next digit in our result. 
Result so far: 28064.5
If we subtract 90 from 90, 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.

Moving on to step 8:
0 divided by 18 is 0 with a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 28064.5
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.

Going ahead to step 9:
18 goes into 0 0 times with a remainder of 0.
The next digit of our result is 0. 
Result so far: 28064.5
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.

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