40957187 divided by 3 
The aim is to understand the frequency of 3 in 40957187.

On to step 1:
If we divide 4 by 3, we get 1 and a remainder of 1.
Write down 1 as next digit of the result. 
Result so far: 1.0
If we take 3 away from 4, we end up with 1.
Append the next digit (0) from the dividend to 1 and continue with: 10 / 3

Going ahead to step 2:
If we divide 10 by 3, we get 3 and a remainder of 1.
Record the quotient 3 as the next digit in the result. 
Result so far: 13.0
The remainder is 1 after subtracting 9 from 10.
Grab the next digit (9) from the dividend, add it to 1, then carry on: 19 / 3

Step 3:
If we divide 19 by 3, we get 6 and a remainder of 1.
Write down 6 as next digit of the result. 
Result so far: 136.0
Subtract 18 from 19 to get 1.
Include the next digit (5) from the dividend after 1, then repeat: 15 / 3

Step 4:
15 divided by 3 is 5 with a remainder of 0.
Record the quotient 5 as the next digit in the result. 
Result so far: 1365.0
Subtracting 15 from 15 leaves us with 0.
Fetch the next digit (7) from the dividend, attach it to 0 and continue: 7 / 3

Step 5:
7 divided by 3 is 2 with a remainder of 1.
Put 2 as the next digit of the answer. 
Result so far: 13652.0
Deduct 6 from 7 and we're left with 1.
Grab the next digit (1) from the dividend, add it to 1, then carry on: 11 / 3

Step 6:
When dividing 11 by 3, we get 3 with a remainder of 2.
Put 3 as the next digit of the answer. 
Result so far: 136523.0
Subtract 9 from 11 to get 2.
Append the next digit (8) from the dividend to 2 and continue with: 28 / 3

Moving on to step 7:
3 can be fit into 28 9 times, resulting in a remainder of 1.
Write down 9 as next digit of the result. 
Result so far: 1365239.0
Subtracting 27 from 28 leaves us with 1.
Bring next digit (7) of the dividend behind the 1 and repeat the process: 17 / 3

Step 8:
The number 3 fits into 17 5 times, leaving a remainder of 2.
The number 5 becomes the next digit in our result. 
Result so far: 13652395.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:
When dividing 20 by 3, we get 6 with a remainder of 2.
The number 6 becomes the next digit in our result. 
Result so far: 13652395.6
Deduct 18 from 20 and we're left 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 10:
20 divided by 3 is 6 with a remainder of 2.
Put 6 as the next digit of the answer. 
Result so far: 13652395.66
If we subtract 18 from 20, we get 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

The final result is 13652395.66 with a remainder of 0.002.