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

Going ahead to step 1:
When dividing 5 by 31, we get 0 with a remainder of 5.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we subtract 0 from 5, we get 5.
Bring next digit (1) of the dividend behind the 5 and repeat the process: 51 / 31

Moving on to step 2:
When dividing 51 by 31, we get 1 with a remainder of 20.
Record the quotient 1 as the next digit in the result. 
Result so far: 1.0
Subtract 31 from 51 to get 20.
Take the next digit (1) from the dividend and append it to 20, then repeat: 201 / 31

Moving on to step 3:
If we divide 201 by 31, we get 6 and a remainder of 15.
Use 6 as the next digit of our solution. 
Result so far: 16.0
Deduct 186 from 201 and we're left with 15.
Bring next digit (7) of the dividend behind the 15 and repeat the process: 157 / 31

On to step 4:
31 can be fit into 157 5 times, resulting in a remainder of 2.
Put 5 as the next digit of the answer. 
Result so far: 165.0
If we take 155 away from 157, we end up with 2.
Grab the next digit (9) from the dividend, add it to 2, then carry on: 29 / 31

Advancing to step 5:
31 goes into 29 0 times with a remainder of 29.
Record the quotient 0 as the next digit in the result. 
Result so far: 1650.0
If we take 0 away from 29, we end up with 29.
Grab the next digit (7) from the dividend, add it to 29, then carry on: 297 / 31

Step 6:
The number 31 fits into 297 9 times, leaving a remainder of 18.
The number 9 becomes the next digit in our result. 
Result so far: 16509.0
Subtract 279 from 297 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.

On to step 7:
If we divide 180 by 31, we get 5 and a remainder of 25.
Record the quotient 5 as the next digit in the result. 
Result so far: 16509.5
Subtracting 155 from 180 leaves us with 25.
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 8:
31 goes into 250 8 times with a remainder of 2.
Put 8 as the next digit of the answer. 
Result so far: 16509.58
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.

Advancing to step 9:
20 divided by 31 is 0 with a remainder of 20.
Use 0 as the next digit of our solution. 
Result so far: 16509.58
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.

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

Going ahead to step 11:
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: 16509.58064
The remainder is 16 after subtracting 124 from 140.
Since there are no more digits in the dividend, we add a zero to the remainder making it 160, and continue the process.

Advancing to step 12:
31 can be fit into 160 5 times, resulting in a remainder of 5.
Record the quotient 5 as the next digit in the result. 
Result so far: 16509.580645
Deduct 155 from 160 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.

On to step 13:
31 can be fit into 50 1 times, resulting in a remainder of 19.
Record the quotient 1 as the next digit in the result. 
Result so far: 16509.5806451
Subtract 31 from 50 to get 19.
Since there are no more digits in the dividend, we add a zero to the remainder making it 190, and continue the process.

Going ahead to step 14:
When dividing 190 by 31, we get 6 with a remainder of 4.
Write down 6 as next digit of the result. 
Result so far: 16509.58064516
Subtracting 186 from 190 leaves us with 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

The quotient of the division is 16509.58064516, and the remainder is 4e-09.