We divide 503317 by 40
We want to figure out the number of times 503317 can be divided by 40.

Step 1:
If we divide 5 by 40, we get 0 and a remainder of 5.
The next digit of our result is 0. 
Result so far: 0.0
Subtracting 0 from 5 leaves us with 5.
Fetch the next digit (0) from the dividend, attach it to 5 and continue: 50 / 40

Moving on to step 2:
40 goes into 50 1 times with a remainder of 10.
The number 1 becomes the next digit in our result. 
Result so far: 1.0
Subtract 40 from 50 to get 10.
Take the next digit (3) from the dividend and append it to 10, then repeat: 103 / 40

Advancing to step 3:
40 can be fit into 103 2 times, resulting in a remainder of 23.
The number 2 becomes the next digit in our result. 
Result so far: 12.0
Deduct 80 from 103 and we're left with 23.
Grab the next digit (3) from the dividend, add it to 23, then carry on: 233 / 40

Step 4:
If we divide 233 by 40, we get 5 and a remainder of 33.
The number 5 becomes the next digit in our result. 
Result so far: 125.0
If we subtract 200 from 233, we get 33.
Append the next digit (1) from the dividend to 33 and continue with: 331 / 40

Moving on to step 5:
40 goes into 331 8 times with a remainder of 11.
Write down 8 as next digit of the result. 
Result so far: 1258.0
The remainder is 11 after subtracting 320 from 331.
Append the next digit (7) from the dividend to 11 and continue with: 117 / 40

Step 6:
117 divided by 40 is 2 with a remainder of 37.
Put 2 as the next digit of the answer. 
Result so far: 12582.0
The remainder is 37 after subtracting 80 from 117.
Since there are no more digits in the dividend, we add a zero to the remainder making it 370, and continue the process.

Step 7:
When dividing 370 by 40, we get 9 with a remainder of 10.
Write down 9 as next digit of the result. 
Result so far: 12582.9
If we subtract 360 from 370, we get 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

On to step 8:
40 can be fit into 100 2 times, resulting in a remainder of 20.
Write down 2 as next digit of the result. 
Result so far: 12582.92
Deduct 80 from 100 and we're left with 20.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Step 9:
When dividing 200 by 40, we get 5 with a remainder of 0.
Record the quotient 5 as the next digit in the result. 
Result so far: 12582.925
Deduct 200 from 200 and we're left with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Advancing to step 10:
The number 40 fits into 0 0 times, leaving a remainder of 0.
Record the quotient 0 as the next digit in the result. 
Result so far: 12582.925
Deduct 0 from 0 and we're left with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Step 11:
The number 40 fits into 0 0 times, leaving a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 12582.925
If we subtract 0 from 0, we get 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

The final result is 12582.925 with a remainder of 0.0.