520312 divided by 40 
The aim is to understand the frequency of 40 in 520312.

Moving on to step 1:
When dividing 5 by 40, we get 0 with a remainder of 5.
Put 0 as the next digit of the answer. 
Result so far: 0.0
Deduct 0 from 5 and we're left with 5.
Take the next digit (2) from the dividend and append it to 5, then repeat: 52 / 40

Moving on to step 2:
When dividing 52 by 40, we get 1 with a remainder of 12.
The number 1 becomes the next digit in our result. 
Result so far: 1.0
If we subtract 40 from 52, we get 12.
Take the next digit (0) from the dividend and append it to 12, then repeat: 120 / 40

Moving on to step 3:
If we divide 120 by 40, we get 3 and a remainder of 0.
Record the quotient 3 as the next digit in the result. 
Result so far: 13.0
If we take 120 away from 120, we end up with 0.
Include the next digit (3) from the dividend after 0, then repeat: 3 / 40

Moving on to step 4:
3 divided by 40 is 0 with a remainder of 3.
Put 0 as the next digit of the answer. 
Result so far: 130.0
Subtracting 0 from 3 leaves us with 3.
Bring next digit (1) of the dividend behind the 3 and repeat the process: 31 / 40

Advancing to step 5:
31 divided by 40 is 0 with a remainder of 31.
Write down 0 as next digit of the result. 
Result so far: 1300.0
Subtract 0 from 31 to get 31.
Grab the next digit (2) from the dividend, add it to 31, then carry on: 312 / 40

Going ahead to step 6:
40 goes into 312 7 times with a remainder of 32.
Put 7 as the next digit of the answer. 
Result so far: 13007.0
The remainder is 32 after subtracting 280 from 312.
Since there are no more digits in the dividend, we add a zero to the remainder making it 320, and continue the process.

Going ahead to step 7:
40 can be fit into 320 8 times, resulting in a remainder of 0.
The number 8 becomes the next digit in our result. 
Result so far: 13007.8
Subtract 320 from 320 to 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.

On to step 8:
0 divided by 40 is 0 with a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 13007.8
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 9:
40 goes into 0 0 times with a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 13007.8
The remainder is 0 after subtracting 0 from 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 13007.8, with a leftover of 0.0.