We look at the division of 504177 by 31 
We're looking to find how many times 31 goes into 504177.

Let's proceed to step 1:
31 can be fit into 5 0 times, resulting in a remainder of 5.
Use 0 as the next digit of our solution. 
Result so far: 0.0
Deduct 0 from 5 and we're left with 5.
Append the next digit (0) from the dividend to 5 and continue with: 50 / 31

Let's proceed to step 2:
If we divide 50 by 31, we get 1 and a remainder of 19.
Put 1 as the next digit of the answer. 
Result so far: 1.0
Subtracting 31 from 50 leaves us with 19.
Grab the next digit (4) from the dividend, add it to 19, then carry on: 194 / 31

On to step 3:
31 goes into 194 6 times with a remainder of 8.
Use 6 as the next digit of our solution. 
Result so far: 16.0
Subtract 186 from 194 to get 8.
Include the next digit (1) from the dividend after 8, then repeat: 81 / 31

Step 4:
31 can be fit into 81 2 times, resulting in a remainder of 19.
The next digit of our result is 2. 
Result so far: 162.0
Subtract 62 from 81 to get 19.
Include the next digit (7) from the dividend after 19, then repeat: 197 / 31

Let's proceed to step 5:
The number 31 fits into 197 6 times, leaving a remainder of 11.
Use 6 as the next digit of our solution. 
Result so far: 1626.0
Subtracting 186 from 197 leaves us with 11.
Include the next digit (7) from the dividend after 11, then repeat: 117 / 31

Going ahead to step 6:
If we divide 117 by 31, we get 3 and a remainder of 24.
Record the quotient 3 as the next digit in the result. 
Result so far: 16263.0
The remainder is 24 after subtracting 93 from 117.
Since there are no more digits in the dividend, we add a zero to the remainder making it 240, and continue the process.

Step 7:
If we divide 240 by 31, we get 7 and a remainder of 23.
Use 7 as the next digit of our solution. 
Result so far: 16263.7
If we take 217 away from 240, we end up with 23.
Since there are no more digits in the dividend, we add a zero to the remainder making it 230, and continue the process.

On to step 8:
If we divide 230 by 31, we get 7 and a remainder of 13.
Use 7 as the next digit of our solution. 
Result so far: 16263.77
The remainder is 13 after subtracting 217 from 230.
Since there are no more digits in the dividend, we add a zero to the remainder making it 130, and continue the process.

The final result is 16263.77 with a remainder of 0.013.