40166740 ÷ 127 
The aim is to understand the frequency of 127 in 40166740.

Step 1:
4 divided by 127 is 0 with a remainder of 4.
Put 0 as the next digit of the answer. 
Result so far: 0.0
If we take 0 away from 4, we end up with 4.
Take the next digit (0) from the dividend and append it to 4, then repeat: 40 / 127

Advancing to step 2:
40 divided by 127 is 0 with a remainder of 40.
Use 0 as the next digit of our solution. 
Result so far: 0.0
Deduct 0 from 40 and we're left with 40.
Bring next digit (1) of the dividend behind the 40 and repeat the process: 401 / 127

Let's proceed to step 3:
127 goes into 401 3 times with a remainder of 20.
Record the quotient 3 as the next digit in the result. 
Result so far: 3.0
Deduct 381 from 401 and we're left with 20.
Bring next digit (6) of the dividend behind the 20 and repeat the process: 206 / 127

Going ahead to step 4:
If we divide 206 by 127, we get 1 and a remainder of 79.
The number 1 becomes the next digit in our result. 
Result so far: 31.0
Subtracting 127 from 206 leaves us with 79.
Append the next digit (6) from the dividend to 79 and continue with: 796 / 127

Going ahead to step 5:
127 can be fit into 796 6 times, resulting in a remainder of 34.
Put 6 as the next digit of the answer. 
Result so far: 316.0
The remainder is 34 after subtracting 762 from 796.
Take the next digit (7) from the dividend and append it to 34, then repeat: 347 / 127

Advancing to step 6:
127 can be fit into 347 2 times, resulting in a remainder of 93.
Write down 2 as next digit of the result. 
Result so far: 3162.0
Subtracting 254 from 347 leaves us with 93.
Bring next digit (4) of the dividend behind the 93 and repeat the process: 934 / 127

Going ahead to step 7:
If we divide 934 by 127, we get 7 and a remainder of 45.
The number 7 becomes the next digit in our result. 
Result so far: 31627.0
Subtract 889 from 934 to get 45.
Fetch the next digit (0) from the dividend, attach it to 45 and continue: 450 / 127

Let's proceed to step 8:
The number 127 fits into 450 3 times, leaving a remainder of 69.
The number 3 becomes the next digit in our result. 
Result so far: 316273.0
Subtracting 381 from 450 leaves us with 69.
Since there are no more digits in the dividend, we add a zero to the remainder making it 690, and continue the process.

Let's proceed to step 9:
127 can be fit into 690 5 times, resulting in a remainder of 55.
The number 5 becomes the next digit in our result. 
Result so far: 316273.5
The remainder is 55 after subtracting 635 from 690.
Since there are no more digits in the dividend, we add a zero to the remainder making it 550, and continue the process.

Step 10:
The number 127 fits into 550 4 times, leaving a remainder of 42.
Record the quotient 4 as the next digit in the result. 
Result so far: 316273.54
If we take 508 away from 550, we end up with 42.
Since there are no more digits in the dividend, we add a zero to the remainder making it 420, and continue the process.

Moving on to step 11:
If we divide 420 by 127, we get 3 and a remainder of 39.
Write down 3 as next digit of the result. 
Result so far: 316273.543
Subtract 381 from 420 to get 39.
Since there are no more digits in the dividend, we add a zero to the remainder making it 390, and continue the process.

Going ahead to step 12:
127 goes into 390 3 times with a remainder of 9.
Use 3 as the next digit of our solution. 
Result so far: 316273.5433
Deduct 381 from 390 and we're left with 9.
Since there are no more digits in the dividend, we add a zero to the remainder making it 90, and continue the process.

After the division, we end up with 316273.5433 and a remainder of 9e-05.