We look at the division of 987613 by 40 
The aim is to understand the frequency of 40 in 987613.

Let's proceed to step 1:
When dividing 9 by 40, we get 0 with a remainder of 9.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
Subtract 0 from 9 to get 9.
Append the next digit (8) from the dividend to 9 and continue with: 98 / 40

Step 2:
The number 40 fits into 98 2 times, leaving a remainder of 18.
Write down 2 as next digit of the result. 
Result so far: 2.0
The remainder is 18 after subtracting 80 from 98.
Append the next digit (7) from the dividend to 18 and continue with: 187 / 40

Going ahead to step 3:
40 goes into 187 4 times with a remainder of 27.
Put 4 as the next digit of the answer. 
Result so far: 24.0
If we subtract 160 from 187, we get 27.
Grab the next digit (6) from the dividend, add it to 27, then carry on: 276 / 40

On to step 4:
276 divided by 40 is 6 with a remainder of 36.
Write down 6 as next digit of the result. 
Result so far: 246.0
If we take 240 away from 276, we end up with 36.
Append the next digit (1) from the dividend to 36 and continue with: 361 / 40

Step 5:
When dividing 361 by 40, we get 9 with a remainder of 1.
Put 9 as the next digit of the answer. 
Result so far: 2469.0
The remainder is 1 after subtracting 360 from 361.
Fetch the next digit (3) from the dividend, attach it to 1 and continue: 13 / 40

Advancing to step 6:
When dividing 13 by 40, we get 0 with a remainder of 13.
Use 0 as the next digit of our solution. 
Result so far: 24690.0
Subtract 0 from 13 to get 13.
Since there are no more digits in the dividend, we add a zero to the remainder making it 130, and continue the process.

Let's proceed to step 7:
If we divide 130 by 40, we get 3 and a remainder of 10.
Record the quotient 3 as the next digit in the result. 
Result so far: 24690.3
Subtract 120 from 130 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:
The number 40 fits into 100 2 times, leaving a remainder of 20.
Write down 2 as next digit of the result. 
Result so far: 24690.32
If we take 80 away from 100, 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.

Going ahead to step 9:
40 can be fit into 200 5 times, resulting in a remainder of 0.
Write down 5 as next digit of the result. 
Result so far: 24690.325
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.

Let's proceed 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: 24690.325
The remainder is 0 after subtracting 0 from 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Moving on to step 11:
When dividing 0 by 40, we get 0 with a remainder of 0.
Record the quotient 0 as the next digit in the result. 
Result so far: 24690.325
The remainder is 0 after subtracting 0 from 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 24690.325 with a remaining 0.0.