504657 ÷ 31 
Let's see how many times 31 fits into 504657.

Going ahead to step 1:
31 goes into 5 0 times with a remainder of 5.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
Subtracting 0 from 5 leaves us with 5.
Include the next digit (0) from the dividend after 5, then repeat: 50 / 31

Let's proceed to step 2:
31 goes into 50 1 times with a remainder of 19.
Record the quotient 1 as the next digit in the result. 
Result so far: 1.0
Subtracting 31 from 50 leaves us with 19.
Append the next digit (4) from the dividend to 19 and continue with: 194 / 31

Let's proceed to step 3:
194 divided by 31 is 6 with a remainder of 8.
The number 6 becomes the next digit in our result. 
Result so far: 16.0
If we take 186 away from 194, we end up with 8.
Append the next digit (6) from the dividend to 8 and continue with: 86 / 31

Step 4:
If we divide 86 by 31, we get 2 and a remainder of 24.
Put 2 as the next digit of the answer. 
Result so far: 162.0
If we subtract 62 from 86, we get 24.
Grab the next digit (5) from the dividend, add it to 24, then carry on: 245 / 31

Advancing to step 5:
The number 31 fits into 245 7 times, leaving a remainder of 28.
The number 7 becomes the next digit in our result. 
Result so far: 1627.0
If we subtract 217 from 245, we get 28.
Take the next digit (7) from the dividend and append it to 28, then repeat: 287 / 31

Moving on to step 6:
287 divided by 31 is 9 with a remainder of 8.
Record the quotient 9 as the next digit in the result. 
Result so far: 16279.0
If we take 279 away from 287, 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.

Advancing to step 7:
If we divide 80 by 31, we get 2 and a remainder of 18.
Record the quotient 2 as the next digit in the result. 
Result so far: 16279.2
Subtract 62 from 80 to get 18.
Since there are no more digits in the dividend, we add a zero to the remainder making it 180, and continue the process.

Going ahead to step 8:
180 divided by 31 is 5 with a remainder of 25.
The number 5 becomes the next digit in our result. 
Result so far: 16279.25
The remainder is 25 after subtracting 155 from 180.
Since there are no more digits in the dividend, we add a zero to the remainder making it 250, and continue the process.

Let's proceed to step 9:
The number 31 fits into 250 8 times, leaving a remainder of 2.
The next digit of our result is 8. 
Result so far: 16279.258
Subtracting 248 from 250 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.

On to step 10:
When dividing 20 by 31, we get 0 with a remainder of 20.
Write down 0 as next digit of the result. 
Result so far: 16279.258
The remainder is 20 after subtracting 0 from 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

On to step 11:
The number 31 fits into 200 6 times, leaving a remainder of 14.
The next digit of our result is 6. 
Result so far: 16279.25806
If we subtract 186 from 200, we get 14.
Since there are no more digits in the dividend, we add a zero to the remainder making it 140, and continue the process.

Advancing to step 12:
If we divide 140 by 31, we get 4 and a remainder of 16.
Use 4 as the next digit of our solution. 
Result so far: 16279.258064
Subtracting 124 from 140 leaves us with 16.
Since there are no more digits in the dividend, we add a zero to the remainder making it 160, and continue the process.

Going ahead to step 13:
31 goes into 160 5 times with a remainder of 5.
The number 5 becomes the next digit in our result. 
Result so far: 16279.2580645
If we take 155 away from 160, 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 14:
The number 31 fits into 50 1 times, leaving a remainder of 19.
Use 1 as the next digit of our solution. 
Result so far: 16279.25806451
If we take 31 away from 50, we end up with 19.
Since there are no more digits in the dividend, we add a zero to the remainder making it 190, and continue the process.

In conclusion, the division gives 16279.25806451 with a balance of 1.9e-08.