Let's divide 542987 by 6
The aim is to understand the frequency of 6 in 542987.

Moving on to step 1:
When dividing 5 by 6, we get 0 with a remainder of 5.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we subtract 0 from 5, we get 5.
Append the next digit (4) from the dividend to 5 and continue with: 54 / 6

Let's proceed to step 2:
If we divide 54 by 6, we get 9 and a remainder of 0.
The number 9 becomes the next digit in our result. 
Result so far: 9.0
The remainder is 0 after subtracting 54 from 54.
Fetch the next digit (2) from the dividend, attach it to 0 and continue: 2 / 6

On to step 3:
2 divided by 6 is 0 with a remainder of 2.
Use 0 as the next digit of our solution. 
Result so far: 90.0
Subtracting 0 from 2 leaves us with 2.
Include the next digit (9) from the dividend after 2, then repeat: 29 / 6

Let's proceed to step 4:
If we divide 29 by 6, we get 4 and a remainder of 5.
Record the quotient 4 as the next digit in the result. 
Result so far: 904.0
Subtract 24 from 29 to get 5.
Grab the next digit (8) from the dividend, add it to 5, then carry on: 58 / 6

Going ahead to step 5:
6 goes into 58 9 times with a remainder of 4.
Record the quotient 9 as the next digit in the result. 
Result so far: 9049.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 / 6

Advancing to step 6:
If we divide 47 by 6, we get 7 and a remainder of 5.
Put 7 as the next digit of the answer. 
Result so far: 90497.0
Subtracting 42 from 47 leaves us with 5.
Since there are no more digits in the dividend, we add a zero to the remainder making it 50, and continue the process.

Let's proceed to step 7:
When dividing 50 by 6, we get 8 with a remainder of 2.
Put 8 as the next digit of the answer. 
Result so far: 90497.8
If we take 48 away from 50, we end up with 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

Moving on to step 8:
6 goes into 20 3 times with a remainder of 2.
Use 3 as the next digit of our solution. 
Result so far: 90497.83
If we take 18 away from 20, we end up with 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

On to step 9:
20 divided by 6 is 3 with a remainder of 2.
Put 3 as the next digit of the answer. 
Result so far: 90497.833
Subtracting 18 from 20 leaves us with 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

Our division results in 90497.833 with a remaining 0.0002.