Let's divide 40511002 by 331
The aim is to understand the frequency of 331 in 40511002.

Going ahead to step 1:
The number 331 fits into 4 0 times, leaving a remainder of 4.
The number 0 becomes the next digit in our result. 
Result so far: 0.0
Deduct 0 from 4 and we're left with 4.
Bring next digit (0) of the dividend behind the 4 and repeat the process: 40 / 331

Let's proceed to step 2:
When dividing 40 by 331, we get 0 with a remainder of 40.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we take 0 away from 40, we end up with 40.
Bring next digit (5) of the dividend behind the 40 and repeat the process: 405 / 331

Advancing to step 3:
The number 331 fits into 405 1 times, leaving a remainder of 74.
Use 1 as the next digit of our solution. 
Result so far: 1.0
Subtract 331 from 405 to get 74.
Take the next digit (1) from the dividend and append it to 74, then repeat: 741 / 331

Let's proceed to step 4:
331 goes into 741 2 times with a remainder of 79.
The next digit of our result is 2. 
Result so far: 12.0
Subtracting 662 from 741 leaves us with 79.
Bring next digit (1) of the dividend behind the 79 and repeat the process: 791 / 331

Advancing to step 5:
The number 331 fits into 791 2 times, leaving a remainder of 129.
Put 2 as the next digit of the answer. 
Result so far: 122.0
Subtracting 662 from 791 leaves us with 129.
Append the next digit (0) from the dividend to 129 and continue with: 1290 / 331

Moving on to step 6:
331 can be fit into 1290 3 times, resulting in a remainder of 297.
The number 3 becomes the next digit in our result. 
Result so far: 1223.0
If we take 993 away from 1290, we end up with 297.
Take the next digit (0) from the dividend and append it to 297, then repeat: 2970 / 331

Advancing to step 7:
331 goes into 2970 8 times with a remainder of 322.
Put 8 as the next digit of the answer. 
Result so far: 12238.0
If we subtract 2648 from 2970, we get 322.
Include the next digit (2) from the dividend after 322, then repeat: 3222 / 331

On to step 8:
The number 331 fits into 3222 9 times, leaving a remainder of 243.
Use 9 as the next digit of our solution. 
Result so far: 122389.0
Subtracting 2979 from 3222 leaves us with 243.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2430, and continue the process.

Step 9:
2430 divided by 331 is 7 with a remainder of 113.
Use 7 as the next digit of our solution. 
Result so far: 122389.7
Subtracting 2317 from 2430 leaves us with 113.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1130, and continue the process.

Moving on to step 10:
1130 divided by 331 is 3 with a remainder of 137.
Put 3 as the next digit of the answer. 
Result so far: 122389.73
Deduct 993 from 1130 and we're left with 137.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1370, and continue the process.

Advancing to step 11:
When dividing 1370 by 331, we get 4 with a remainder of 46.
The number 4 becomes the next digit in our result. 
Result so far: 122389.734
Subtracting 1324 from 1370 leaves us with 46.
Since there are no more digits in the dividend, we add a zero to the remainder making it 460, and continue the process.

On to step 12:
When dividing 460 by 331, we get 1 with a remainder of 129.
The next digit of our result is 1. 
Result so far: 122389.7341
Subtracting 331 from 460 leaves us with 129.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1290, and continue the process.

Moving on to step 13:
When dividing 1290 by 331, we get 3 with a remainder of 297.
Use 3 as the next digit of our solution. 
Result so far: 122389.73413
Subtracting 993 from 1290 leaves us with 297.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2970, and continue the process.

Step 14:
If we divide 2970 by 331, we get 8 and a remainder of 322.
Use 8 as the next digit of our solution. 
Result so far: 122389.734138
If we take 2648 away from 2970, we end up with 322.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3220, and continue the process.

Advancing to step 15:
331 goes into 3220 9 times with a remainder of 241.
The number 9 becomes the next digit in our result. 
Result so far: 122389.7341389
Deduct 2979 from 3220 and we're left with 241.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2410, and continue the process.

Step 16:
2410 divided by 331 is 7 with a remainder of 93.
The next digit of our result is 7. 
Result so far: 122389.73413897
If we take 2317 away from 2410, we end up with 93.
Since there are no more digits in the dividend, we add a zero to the remainder making it 930, and continue the process.

The final outcome is 122389.73413897, with a leftover of 9.3e-08.