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

Step 1:
The number 40 fits into 9 0 times, leaving a remainder of 9.
The next digit of our result is 0. 
Result so far: 0.0
If we subtract 0 from 9, we get 9.
Include the next digit (6) from the dividend after 9, then repeat: 96 / 40

Going ahead to step 2:
The number 40 fits into 96 2 times, leaving a remainder of 16.
Put 2 as the next digit of the answer. 
Result so far: 2.0
Subtract 80 from 96 to get 16.
Grab the next digit (6) from the dividend, add it to 16, then carry on: 166 / 40

On to step 3:
40 goes into 166 4 times with a remainder of 6.
The next digit of our result is 4. 
Result so far: 24.0
Deduct 160 from 166 and we're left with 6.
Fetch the next digit (5) from the dividend, attach it to 6 and continue: 65 / 40

Going ahead to step 4:
40 can be fit into 65 1 times, resulting in a remainder of 25.
The number 1 becomes the next digit in our result. 
Result so far: 241.0
If we take 40 away from 65, we end up with 25.
Include the next digit (5) from the dividend after 25, then repeat: 255 / 40

On to step 5:
40 goes into 255 6 times with a remainder of 15.
Record the quotient 6 as the next digit in the result. 
Result so far: 2416.0
If we take 240 away from 255, we end up with 15.
Grab the next digit (1) from the dividend, add it to 15, then carry on: 151 / 40

On to step 6:
The number 40 fits into 151 3 times, leaving a remainder of 31.
The next digit of our result is 3. 
Result so far: 24163.0
If we take 120 away from 151, we end up with 31.
Since there are no more digits in the dividend, we add a zero to the remainder making it 310, and continue the process.

Moving on to step 7:
40 can be fit into 310 7 times, resulting in a remainder of 30.
Use 7 as the next digit of our solution. 
Result so far: 24163.7
Subtract 280 from 310 to get 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

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

The quotient of the division is 24163.77, and the remainder is 0.02.