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

Going ahead to step 1:
40 goes into 8 0 times with a remainder of 8.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we take 0 away from 8, we end up with 8.
Take the next digit (9) from the dividend and append it to 8, then repeat: 89 / 40

On to step 2:
The number 40 fits into 89 2 times, leaving a remainder of 9.
Put 2 as the next digit of the answer. 
Result so far: 2.0
If we subtract 80 from 89, we get 9.
Take the next digit (7) from the dividend and append it to 9, then repeat: 97 / 40

On to step 3:
When dividing 97 by 40, we get 2 with a remainder of 17.
The number 2 becomes the next digit in our result. 
Result so far: 22.0
The remainder is 17 after subtracting 80 from 97.
Take the next digit (7) from the dividend and append it to 17, then repeat: 177 / 40

Step 4:
When dividing 177 by 40, we get 4 with a remainder of 17.
Put 4 as the next digit of the answer. 
Result so far: 224.0
Deduct 160 from 177 and we're left with 17.
Take the next digit (6) from the dividend and append it to 17, then repeat: 176 / 40

Going ahead to step 5:
176 divided by 40 is 4 with a remainder of 16.
Record the quotient 4 as the next digit in the result. 
Result so far: 2244.0
If we subtract 160 from 176, we get 16.
Include the next digit (5) from the dividend after 16, then repeat: 165 / 40

Advancing to step 6:
When dividing 165 by 40, we get 4 with a remainder of 5.
Write down 4 as next digit of the result. 
Result so far: 22444.0
If we subtract 160 from 165, we get 5.
Since there are no more digits in the dividend, we add a zero to the remainder making it 50, and continue the process.

Let's proceed to step 7:
The number 40 fits into 50 1 times, leaving a remainder of 10.
Use 1 as the next digit of our solution. 
Result so far: 22444.1
The remainder is 10 after subtracting 40 from 50.
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:
40 can be fit into 100 2 times, resulting in a remainder of 20.
Record the quotient 2 as the next digit in the result. 
Result so far: 22444.12
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:
40 goes into 200 5 times with a remainder of 0.
Record the quotient 5 as the next digit in the result. 
Result so far: 22444.125
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.

Advancing to step 10:
When dividing 0 by 40, we get 0 with a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 22444.125
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 11:
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: 22444.125
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.

After the division, we end up with 22444.125 and a remainder of 0.0.