We look at the division of 977865 by 31 
We want to figure out the number of times 977865 can be divided by 31.

Moving on to step 1:
If we divide 9 by 31, we get 0 and a remainder of 9.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
If we take 0 away from 9, we end up with 9.
Take the next digit (7) from the dividend and append it to 9, then repeat: 97 / 31

Step 2:
If we divide 97 by 31, we get 3 and a remainder of 4.
Put 3 as the next digit of the answer. 
Result so far: 3.0
If we take 93 away from 97, we end up with 4.
Append the next digit (7) from the dividend to 4 and continue with: 47 / 31

Moving on to step 3:
When dividing 47 by 31, we get 1 with a remainder of 16.
Write down 1 as next digit of the result. 
Result so far: 31.0
If we take 31 away from 47, we end up with 16.
Bring next digit (8) of the dividend behind the 16 and repeat the process: 168 / 31

Let's proceed to step 4:
31 goes into 168 5 times with a remainder of 13.
Write down 5 as next digit of the result. 
Result so far: 315.0
Deduct 155 from 168 and we're left with 13.
Fetch the next digit (6) from the dividend, attach it to 13 and continue: 136 / 31

On to step 5:
31 can be fit into 136 4 times, resulting in a remainder of 12.
Use 4 as the next digit of our solution. 
Result so far: 3154.0
Subtracting 124 from 136 leaves us with 12.
Take the next digit (5) from the dividend and append it to 12, then repeat: 125 / 31

Step 6:
31 goes into 125 4 times with a remainder of 1.
Put 4 as the next digit of the answer. 
Result so far: 31544.0
Deduct 124 from 125 and we're left with 1.
Since there are no more digits in the dividend, we add a zero to the remainder making it 10, and continue the process.

Going ahead to step 7:
The number 31 fits into 10 0 times, leaving a remainder of 10.
Put 0 as the next digit of the answer. 
Result so far: 31544.0
The remainder is 10 after subtracting 0 from 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Going ahead to step 8:
The number 31 fits into 100 3 times, leaving a remainder of 7.
Put 3 as the next digit of the answer. 
Result so far: 31544.03
The remainder is 7 after subtracting 93 from 100.
Since there are no more digits in the dividend, we add a zero to the remainder making it 70, and continue the process.

Step 9:
31 can be fit into 70 2 times, resulting in a remainder of 8.
Write down 2 as next digit of the result. 
Result so far: 31544.032
The remainder is 8 after subtracting 62 from 70.
Since there are no more digits in the dividend, we add a zero to the remainder making it 80, and continue the process.

On to step 10:
When dividing 80 by 31, we get 2 with a remainder of 18.
Record the quotient 2 as the next digit in the result. 
Result so far: 31544.0322
If we take 62 away from 80, we end up with 18.
Since there are no more digits in the dividend, we add a zero to the remainder making it 180, and continue the process.

The quotient of the division is 31544.0322, and the remainder is 0.00018.