We look at the division of 997871 by 9 
The aim is to understand the frequency of 9 in 997871.

Advancing to step 1:
9 can be fit into 9 1 times, resulting in a remainder of 0.
Write down 1 as next digit of the result. 
Result so far: 1.0
Subtract 9 from 9 to get 0.
Bring next digit (9) of the dividend behind the 0 and repeat the process: 9 / 9

Advancing to step 2:
When dividing 9 by 9, we get 1 with a remainder of 0.
Record the quotient 1 as the next digit in the result. 
Result so far: 11.0
Subtract 9 from 9 to get 0.
Append the next digit (7) from the dividend to 0 and continue with: 7 / 9

Step 3:
If we divide 7 by 9, we get 0 and a remainder of 7.
Use 0 as the next digit of our solution. 
Result so far: 110.0
Deduct 0 from 7 and we're left with 7.
Grab the next digit (8) from the dividend, add it to 7, then carry on: 78 / 9

Let's proceed to step 4:
78 divided by 9 is 8 with a remainder of 6.
Use 8 as the next digit of our solution. 
Result so far: 1108.0
If we take 72 away from 78, we end up with 6.
Bring next digit (7) of the dividend behind the 6 and repeat the process: 67 / 9

Let's proceed to step 5:
When dividing 67 by 9, we get 7 with a remainder of 4.
The number 7 becomes the next digit in our result. 
Result so far: 11087.0
Subtract 63 from 67 to get 4.
Grab the next digit (1) from the dividend, add it to 4, then carry on: 41 / 9

Going ahead to step 6:
41 divided by 9 is 4 with a remainder of 5.
Use 4 as the next digit of our solution. 
Result so far: 110874.0
If we take 36 away from 41, we end up 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.

Step 7:
The number 9 fits into 50 5 times, leaving a remainder of 5.
Put 5 as the next digit of the answer. 
Result so far: 110874.5
Subtracting 45 from 50 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.

Step 8:
9 can be fit into 50 5 times, resulting in a remainder of 5.
Write down 5 as next digit of the result. 
Result so far: 110874.55
Deduct 45 from 50 and we're left 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.

The final result is 110874.55 with a remainder of 0.005.