Let's divide 40876117 by 5
The aim is to understand the frequency of 5 in 40876117.

Step 1:
4 divided by 5 is 0 with a remainder of 4.
Write down 0 as next digit of the result. 
Result so far: 0.0
Subtracting 0 from 4 leaves us with 4.
Grab the next digit (0) from the dividend, add it to 4, then carry on: 40 / 5

Moving on to step 2:
If we divide 40 by 5, we get 8 and a remainder of 0.
Use 8 as the next digit of our solution. 
Result so far: 8.0
If we subtract 40 from 40, we get 0.
Grab the next digit (8) from the dividend, add it to 0, then carry on: 8 / 5

Advancing to step 3:
8 divided by 5 is 1 with a remainder of 3.
The number 1 becomes the next digit in our result. 
Result so far: 81.0
If we take 5 away from 8, we end up with 3.
Take the next digit (7) from the dividend and append it to 3, then repeat: 37 / 5

Going ahead to step 4:
5 goes into 37 7 times with a remainder of 2.
The next digit of our result is 7. 
Result so far: 817.0
If we subtract 35 from 37, we get 2.
Take the next digit (6) from the dividend and append it to 2, then repeat: 26 / 5

Step 5:
26 divided by 5 is 5 with a remainder of 1.
Write down 5 as next digit of the result. 
Result so far: 8175.0
Subtract 25 from 26 to get 1.
Append the next digit (1) from the dividend to 1 and continue with: 11 / 5

Advancing to step 6:
The number 5 fits into 11 2 times, leaving a remainder of 1.
Put 2 as the next digit of the answer. 
Result so far: 81752.0
Subtracting 10 from 11 leaves us with 1.
Fetch the next digit (1) from the dividend, attach it to 1 and continue: 11 / 5

Moving on to step 7:
5 can be fit into 11 2 times, resulting in a remainder of 1.
Write down 2 as next digit of the result. 
Result so far: 817522.0
Deduct 10 from 11 and we're left with 1.
Bring next digit (7) of the dividend behind the 1 and repeat the process: 17 / 5

On to step 8:
The number 5 fits into 17 3 times, leaving a remainder of 2.
The number 3 becomes the next digit in our result. 
Result so far: 8175223.0
Subtracting 15 from 17 leaves us with 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

Moving on to step 9:
5 goes into 20 4 times with a remainder of 0.
Put 4 as the next digit of the answer. 
Result so far: 8175223.4
Deduct 20 from 20 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.

On to step 10:
When dividing 0 by 5, we get 0 with a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 8175223.4
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.

Step 11:
0 divided by 5 is 0 with a remainder of 0.
Put 0 as the next digit of the answer. 
Result so far: 8175223.4
If we take 0 away from 0, we end up 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 8175223.4 and a remainder of 0.0.