31814572 divided by 789 
The aim is to understand the frequency of 789 in 31814572.

Going ahead to step 1:
If we divide 3 by 789, we get 0 and a remainder of 3.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 3 after subtracting 0 from 3.
Take the next digit (1) from the dividend and append it to 3, then repeat: 31 / 789

On to step 2:
The number 789 fits into 31 0 times, leaving a remainder of 31.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 31 after subtracting 0 from 31.
Fetch the next digit (8) from the dividend, attach it to 31 and continue: 318 / 789

Let's proceed to step 3:
789 can be fit into 318 0 times, resulting in a remainder of 318.
Put 0 as the next digit of the answer. 
Result so far: 0.0
The remainder is 318 after subtracting 0 from 318.
Include the next digit (1) from the dividend after 318, then repeat: 3181 / 789

Moving on to step 4:
3181 divided by 789 is 4 with a remainder of 25.
The next digit of our result is 4. 
Result so far: 4.0
Subtract 3156 from 3181 to get 25.
Bring next digit (4) of the dividend behind the 25 and repeat the process: 254 / 789

On to step 5:
If we divide 254 by 789, we get 0 and a remainder of 254.
Record the quotient 0 as the next digit in the result. 
Result so far: 40.0
If we take 0 away from 254, we end up with 254.
Take the next digit (5) from the dividend and append it to 254, then repeat: 2545 / 789

Step 6:
789 can be fit into 2545 3 times, resulting in a remainder of 178.
Put 3 as the next digit of the answer. 
Result so far: 403.0
Subtracting 2367 from 2545 leaves us with 178.
Bring next digit (7) of the dividend behind the 178 and repeat the process: 1787 / 789

Let's proceed to step 7:
When dividing 1787 by 789, we get 2 with a remainder of 209.
Use 2 as the next digit of our solution. 
Result so far: 4032.0
If we subtract 1578 from 1787, we get 209.
Fetch the next digit (2) from the dividend, attach it to 209 and continue: 2092 / 789

Moving on to step 8:
When dividing 2092 by 789, we get 2 with a remainder of 514.
The next digit of our result is 2. 
Result so far: 40322.0
If we subtract 1578 from 2092, we get 514.
Since there are no more digits in the dividend, we add a zero to the remainder making it 5140, and continue the process.

Advancing to step 9:
When dividing 5140 by 789, we get 6 with a remainder of 406.
Write down 6 as next digit of the result. 
Result so far: 40322.6
If we subtract 4734 from 5140, we get 406.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4060, and continue the process.

Step 10:
789 can be fit into 4060 5 times, resulting in a remainder of 115.
The number 5 becomes the next digit in our result. 
Result so far: 40322.65
If we take 3945 away from 4060, we end up with 115.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1150, and continue the process.

Going ahead to step 11:
789 can be fit into 1150 1 times, resulting in a remainder of 361.
Put 1 as the next digit of the answer. 
Result so far: 40322.651
If we take 789 away from 1150, we end up with 361.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3610, and continue the process.

On to step 12:
789 goes into 3610 4 times with a remainder of 454.
Put 4 as the next digit of the answer. 
Result so far: 40322.6514
Deduct 3156 from 3610 and we're left with 454.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4540, and continue the process.

Advancing to step 13:
The number 789 fits into 4540 5 times, leaving a remainder of 595.
Record the quotient 5 as the next digit in the result. 
Result so far: 40322.65145
If we take 3945 away from 4540, we end up with 595.
Since there are no more digits in the dividend, we add a zero to the remainder making it 5950, and continue the process.

Advancing to step 14:
789 goes into 5950 7 times with a remainder of 427.
Record the quotient 7 as the next digit in the result. 
Result so far: 40322.651457
Deduct 5523 from 5950 and we're left with 427.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4270, and continue the process.

Going ahead to step 15:
When dividing 4270 by 789, we get 5 with a remainder of 325.
Put 5 as the next digit of the answer. 
Result so far: 40322.6514575
The remainder is 325 after subtracting 3945 from 4270.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3250, and continue the process.

Step 16:
If we divide 3250 by 789, we get 4 and a remainder of 94.
Record the quotient 4 as the next digit in the result. 
Result so far: 40322.65145754
Subtracting 3156 from 3250 leaves us with 94.
Since there are no more digits in the dividend, we add a zero to the remainder making it 940, and continue the process.

The final outcome is 40322.65145754, with a leftover of 9.4e-08.