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

Let's proceed to step 1:
40 can be fit into 8 0 times, resulting in a remainder of 8.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 8 after subtracting 0 from 8.
Fetch the next digit (9) from the dividend, attach it to 8 and continue: 89 / 40

Going ahead to step 2:
When dividing 89 by 40, we get 2 with a remainder of 9.
The number 2 becomes the next digit in our result. 
Result so far: 2.0
Subtracting 80 from 89 leaves us with 9.
Grab the next digit (7) from the dividend, add it to 9, then carry on: 97 / 40

Advancing to step 3:
If we divide 97 by 40, we get 2 and a remainder of 17.
Write down 2 as next digit of the result. 
Result so far: 22.0
Subtracting 80 from 97 leaves us with 17.
Include the next digit (6) from the dividend after 17, then repeat: 176 / 40

Step 4:
40 can be fit into 176 4 times, resulting in a remainder of 16.
The number 4 becomes the next digit in our result. 
Result so far: 224.0
If we subtract 160 from 176, we get 16.
Include the next digit (8) from the dividend after 16, then repeat: 168 / 40

Moving on to step 5:
When dividing 168 by 40, we get 4 with a remainder of 8.
The next digit of our result is 4. 
Result so far: 2244.0
Subtracting 160 from 168 leaves us with 8.
Include the next digit (7) from the dividend after 8, then repeat: 87 / 40

Advancing to step 6:
40 goes into 87 2 times with a remainder of 7.
Put 2 as the next digit of the answer. 
Result so far: 22442.0
Deduct 80 from 87 and we're left with 7.
Since there are no more digits in the dividend, we add a zero to the remainder making it 70, and continue the process.

Going ahead to step 7:
40 can be fit into 70 1 times, resulting in a remainder of 30.
Record the quotient 1 as the next digit in the result. 
Result so far: 22442.1
Deduct 40 from 70 and we're left with 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:
If we divide 300 by 40, we get 7 and a remainder of 20.
Record the quotient 7 as the next digit in the result. 
Result so far: 22442.17
If we take 280 away from 300, we end up 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.

Step 9:
40 goes into 200 5 times with a remainder of 0.
Put 5 as the next digit of the answer. 
Result so far: 22442.175
Subtracting 200 from 200 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.

Let's proceed to step 10:
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: 22442.175
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.

Going ahead to step 11:
If we divide 0 by 40, we get 0 and a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 22442.175
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.

The quotient of the division is 22442.175, and the remainder is 0.0.