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

Moving on to step 1:
40 can be fit into 7 0 times, resulting in a remainder of 7.
Write down 0 as next digit of the result. 
Result so far: 0.0
Subtract 0 from 7 to get 7.
Take the next digit (8) from the dividend and append it to 7, then repeat: 78 / 40

Going ahead to step 2:
The number 40 fits into 78 1 times, leaving a remainder of 38.
Write down 1 as next digit of the result. 
Result so far: 1.0
The remainder is 38 after subtracting 40 from 78.
Fetch the next digit (8) from the dividend, attach it to 38 and continue: 388 / 40

Going ahead to step 3:
When dividing 388 by 40, we get 9 with a remainder of 28.
Put 9 as the next digit of the answer. 
Result so far: 19.0
Subtracting 360 from 388 leaves us with 28.
Append the next digit (9) from the dividend to 28 and continue with: 289 / 40

Advancing to step 4:
40 can be fit into 289 7 times, resulting in a remainder of 9.
The next digit of our result is 7. 
Result so far: 197.0
Subtract 280 from 289 to get 9.
Grab the next digit (6) from the dividend, add it to 9, then carry on: 96 / 40

Moving on to step 5:
40 can be fit into 96 2 times, resulting in a remainder of 16.
Write down 2 as next digit of the result. 
Result so far: 1972.0
Subtracting 80 from 96 leaves us with 16.
Take the next digit (1) from the dividend and append it to 16, then repeat: 161 / 40

Moving on to step 6:
40 goes into 161 4 times with a remainder of 1.
Put 4 as the next digit of the answer. 
Result so far: 19724.0
Subtract 160 from 161 to get 1.
Since there are no more digits in the dividend, we add a zero to the remainder making it 10, and continue the process.

Advancing to step 7:
40 can be fit into 10 0 times, resulting in a remainder of 10.
The next digit of our result is 0. 
Result so far: 19724.0
Subtract 0 from 10 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.

On to step 8:
If we divide 100 by 40, we get 2 and a remainder of 20.
The next digit of our result is 2. 
Result so far: 19724.02
Subtracting 80 from 100 leaves us 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:
200 divided by 40 is 5 with a remainder of 0.
Record the quotient 5 as the next digit in the result. 
Result so far: 19724.025
If we subtract 200 from 200, 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.

On to step 10:
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: 19724.025
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.

Advancing to step 11:
40 goes into 0 0 times with a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 19724.025
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 result is 19724.025 with a remainder of 0.0.