We divide 861731 by 9
The aim is to understand the frequency of 9 in 861731.

Advancing to step 1:
If we divide 8 by 9, we get 0 and a remainder of 8.
Put 0 as the next digit of the answer. 
Result so far: 0.0
Deduct 0 from 8 and we're left with 8.
Grab the next digit (6) from the dividend, add it to 8, then carry on: 86 / 9

Moving on to step 2:
86 divided by 9 is 9 with a remainder of 5.
The number 9 becomes the next digit in our result. 
Result so far: 9.0
If we take 81 away from 86, we end up with 5.
Grab the next digit (1) from the dividend, add it to 5, then carry on: 51 / 9

On to step 3:
9 goes into 51 5 times with a remainder of 6.
Write down 5 as next digit of the result. 
Result so far: 95.0
Subtracting 45 from 51 leaves us with 6.
Take the next digit (7) from the dividend and append it to 6, then repeat: 67 / 9

Advancing to step 4:
67 divided by 9 is 7 with a remainder of 4.
Put 7 as the next digit of the answer. 
Result so far: 957.0
If we take 63 away from 67, we end up with 4.
Take the next digit (3) from the dividend and append it to 4, then repeat: 43 / 9

Moving on to step 5:
When dividing 43 by 9, we get 4 with a remainder of 7.
The number 4 becomes the next digit in our result. 
Result so far: 9574.0
Subtract 36 from 43 to get 7.
Fetch the next digit (1) from the dividend, attach it to 7 and continue: 71 / 9

Let's proceed to step 6:
9 can be fit into 71 7 times, resulting in a remainder of 8.
The next digit of our result is 7. 
Result so far: 95747.0
Subtracting 63 from 71 leaves us with 8.
Since there are no more digits in the dividend, we add a zero to the remainder making it 80, and continue the process.

Let's proceed to step 7:
The number 9 fits into 80 8 times, leaving a remainder of 8.
Write down 8 as next digit of the result. 
Result so far: 95747.8
Deduct 72 from 80 and we're left with 8.
Since there are no more digits in the dividend, we add a zero to the remainder making it 80, and continue the process.

Moving on to step 8:
9 can be fit into 80 8 times, resulting in a remainder of 8.
The number 8 becomes the next digit in our result. 
Result so far: 95747.88
If we take 72 away from 80, we end up with 8.
Since there are no more digits in the dividend, we add a zero to the remainder making it 80, and continue the process.

The final outcome is 95747.88, with a leftover of 0.008.