We're dividing 790564 by 40 
The aim is to understand the frequency of 40 in 790564.

Step 1:
7 divided by 40 is 0 with a remainder of 7.
Use 0 as the next digit of our solution. 
Result so far: 0.0
Subtracting 0 from 7 leaves us with 7.
Include the next digit (9) from the dividend after 7, then repeat: 79 / 40

Going ahead to step 2:
40 goes into 79 1 times with a remainder of 39.
Put 1 as the next digit of the answer. 
Result so far: 1.0
The remainder is 39 after subtracting 40 from 79.
Append the next digit (0) from the dividend to 39 and continue with: 390 / 40

Going ahead to step 3:
If we divide 390 by 40, we get 9 and a remainder of 30.
Write down 9 as next digit of the result. 
Result so far: 19.0
Subtracting 360 from 390 leaves us with 30.
Fetch the next digit (5) from the dividend, attach it to 30 and continue: 305 / 40

On to step 4:
305 divided by 40 is 7 with a remainder of 25.
Use 7 as the next digit of our solution. 
Result so far: 197.0
The remainder is 25 after subtracting 280 from 305.
Append the next digit (6) from the dividend to 25 and continue with: 256 / 40

On to step 5:
If we divide 256 by 40, we get 6 and a remainder of 16.
The next digit of our result is 6. 
Result so far: 1976.0
The remainder is 16 after subtracting 240 from 256.
Fetch the next digit (4) from the dividend, attach it to 16 and continue: 164 / 40

Moving on to step 6:
40 goes into 164 4 times with a remainder of 4.
Write down 4 as next digit of the result. 
Result so far: 19764.0
The remainder is 4 after subtracting 160 from 164.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

Advancing to step 7:
40 can be fit into 40 1 times, resulting in a remainder of 0.
Use 1 as the next digit of our solution. 
Result so far: 19764.1
Subtract 40 from 40 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:
If we divide 0 by 40, we get 0 and a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 19764.1
Subtract 0 from 0 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 9:
0 divided by 40 is 0 with a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 19764.1
Subtract 0 from 0 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.

In conclusion, the division gives 19764.1 with a balance of 0.0.