794017 ÷ 40 
The aim is to understand the frequency of 40 in 794017.

Let's proceed to step 1:
7 divided by 40 is 0 with a remainder of 7.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we take 0 away from 7, we end up with 7.
Take the next digit (9) from the dividend and append it to 7, then repeat: 79 / 40

Let's proceed to step 2:
If we divide 79 by 40, we get 1 and a remainder of 39.
Write down 1 as next digit of the result. 
Result so far: 1.0
If we take 40 away from 79, we end up with 39.
Take the next digit (4) from the dividend and append it to 39, then repeat: 394 / 40

On to step 3:
394 divided by 40 is 9 with a remainder of 34.
The number 9 becomes the next digit in our result. 
Result so far: 19.0
The remainder is 34 after subtracting 360 from 394.
Grab the next digit (0) from the dividend, add it to 34, then carry on: 340 / 40

Going ahead to step 4:
40 goes into 340 8 times with a remainder of 20.
The number 8 becomes the next digit in our result. 
Result so far: 198.0
If we subtract 320 from 340, we get 20.
Fetch the next digit (1) from the dividend, attach it to 20 and continue: 201 / 40

Moving on to step 5:
40 goes into 201 5 times with a remainder of 1.
The next digit of our result is 5. 
Result so far: 1985.0
Deduct 200 from 201 and we're left with 1.
Include the next digit (7) from the dividend after 1, then repeat: 17 / 40

Moving on to step 6:
If we divide 17 by 40, we get 0 and a remainder of 17.
Use 0 as the next digit of our solution. 
Result so far: 19850.0
If we subtract 0 from 17, we get 17.
Since there are no more digits in the dividend, we add a zero to the remainder making it 170, and continue the process.

Let's proceed to step 7:
40 goes into 170 4 times with a remainder of 10.
Put 4 as the next digit of the answer. 
Result so far: 19850.4
Subtract 160 from 170 to 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.

Moving on to step 8:
40 can be fit into 100 2 times, resulting in a remainder of 20.
The number 2 becomes the next digit in our result. 
Result so far: 19850.42
Subtract 80 from 100 to get 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 9:
The number 40 fits into 200 5 times, leaving a remainder of 0.
Write down 5 as next digit of the result. 
Result so far: 19850.425
The remainder is 0 after subtracting 200 from 200.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Step 10:
0 divided by 40 is 0 with a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 19850.425
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.

Advancing to step 11:
The number 40 fits into 0 0 times, leaving a remainder of 0.
The number 0 becomes the next digit in our result. 
Result so far: 19850.425
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.

Our division results in 19850.425 with a remaining 0.0.