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

Let's proceed to step 1:
6 divided by 40 is 0 with a remainder of 6.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
If we subtract 0 from 6, we get 6.
Include the next digit (3) from the dividend after 6, then repeat: 63 / 40

Moving on to step 2:
The number 40 fits into 63 1 times, leaving a remainder of 23.
The number 1 becomes the next digit in our result. 
Result so far: 1.0
If we subtract 40 from 63, we get 23.
Append the next digit (6) from the dividend to 23 and continue with: 236 / 40

Moving on to step 3:
The number 40 fits into 236 5 times, leaving a remainder of 36.
Record the quotient 5 as the next digit in the result. 
Result so far: 15.0
If we subtract 200 from 236, we get 36.
Bring next digit (6) of the dividend behind the 36 and repeat the process: 366 / 40

Let's proceed to step 4:
40 goes into 366 9 times with a remainder of 6.
Use 9 as the next digit of our solution. 
Result so far: 159.0
Deduct 360 from 366 and we're left with 6.
Include the next digit (3) from the dividend after 6, then repeat: 63 / 40

Moving on to step 5:
The number 40 fits into 63 1 times, leaving a remainder of 23.
Record the quotient 1 as the next digit in the result. 
Result so far: 1591.0
Deduct 40 from 63 and we're left with 23.
Append the next digit (1) from the dividend to 23 and continue with: 231 / 40

Step 6:
When dividing 231 by 40, we get 5 with a remainder of 31.
The number 5 becomes the next digit in our result. 
Result so far: 15915.0
The remainder is 31 after subtracting 200 from 231.
Since there are no more digits in the dividend, we add a zero to the remainder making it 310, and continue the process.

On to step 7:
310 divided by 40 is 7 with a remainder of 30.
Record the quotient 7 as the next digit in the result. 
Result so far: 15915.7
Deduct 280 from 310 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.
The next digit of our result is 7. 
Result so far: 15915.77
Subtract 280 from 300 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.

The final result is 15915.77 with a remainder of 0.02.