581365 divided by 40 
We're looking to find how many times 40 goes into 581365.

Step 1:
40 can be fit into 5 0 times, resulting in a remainder of 5.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
The remainder is 5 after subtracting 0 from 5.
Take the next digit (8) from the dividend and append it to 5, then repeat: 58 / 40

Going ahead to step 2:
58 divided by 40 is 1 with a remainder of 18.
Put 1 as the next digit of the answer. 
Result so far: 1.0
Subtracting 40 from 58 leaves us with 18.
Bring next digit (1) of the dividend behind the 18 and repeat the process: 181 / 40

Let's proceed to step 3:
40 can be fit into 181 4 times, resulting in a remainder of 21.
The next digit of our result is 4. 
Result so far: 14.0
Subtract 160 from 181 to get 21.
Fetch the next digit (3) from the dividend, attach it to 21 and continue: 213 / 40

On to step 4:
40 goes into 213 5 times with a remainder of 13.
The next digit of our result is 5. 
Result so far: 145.0
If we take 200 away from 213, we end up with 13.
Fetch the next digit (6) from the dividend, attach it to 13 and continue: 136 / 40

Moving on to step 5:
The number 40 fits into 136 3 times, leaving a remainder of 16.
Put 3 as the next digit of the answer. 
Result so far: 1453.0
If we take 120 away from 136, we end up with 16.
Bring next digit (5) of the dividend behind the 16 and repeat the process: 165 / 40

Advancing to step 6:
40 goes into 165 4 times with a remainder of 5.
The number 4 becomes the next digit in our result. 
Result so far: 14534.0
If we subtract 160 from 165, we get 5.
Since there are no more digits in the dividend, we add a zero to the remainder making it 50, and continue the process.

Going ahead to step 7:
40 goes into 50 1 times with a remainder of 10.
Use 1 as the next digit of our solution. 
Result so far: 14534.1
Deduct 40 from 50 and we're left with 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Moving on to step 8:
40 can be fit into 100 2 times, resulting in a remainder of 20.
The next digit of our result is 2. 
Result so far: 14534.12
If we take 80 away from 100, we end up 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.

Let's proceed to step 9:
The number 40 fits into 200 5 times, leaving a remainder of 0.
The number 5 becomes the next digit in our result. 
Result so far: 14534.125
Subtracting 200 from 200 leaves us 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:
When dividing 0 by 40, we get 0 with a remainder of 0.
Record the quotient 0 as the next digit in the result. 
Result so far: 14534.125
If we take 0 away from 0, we end up 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.

Going ahead to step 11:
If we divide 0 by 40, we get 0 and a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 14534.125
Subtracting 0 from 0 leaves us 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.

The final outcome is 14534.125, with a leftover of 0.0.