We look at the division of 641647 by 31 
The aim is to understand the frequency of 31 in 641647.

Let's proceed to step 1:
The number 31 fits into 6 0 times, leaving a remainder of 6.
Write down 0 as next digit of the result. 
Result so far: 0.0
Subtracting 0 from 6 leaves us with 6.
Fetch the next digit (4) from the dividend, attach it to 6 and continue: 64 / 31

Let's proceed to step 2:
31 goes into 64 2 times with a remainder of 2.
Write down 2 as next digit of the result. 
Result so far: 2.0
If we take 62 away from 64, we end up with 2.
Take the next digit (1) from the dividend and append it to 2, then repeat: 21 / 31

Moving on to step 3:
The number 31 fits into 21 0 times, leaving a remainder of 21.
Use 0 as the next digit of our solution. 
Result so far: 20.0
If we take 0 away from 21, we end up with 21.
Fetch the next digit (6) from the dividend, attach it to 21 and continue: 216 / 31

Step 4:
216 divided by 31 is 6 with a remainder of 30.
The next digit of our result is 6. 
Result so far: 206.0
Deduct 186 from 216 and we're left with 30.
Take the next digit (4) from the dividend and append it to 30, then repeat: 304 / 31

Moving on to step 5:
31 goes into 304 9 times with a remainder of 25.
The next digit of our result is 9. 
Result so far: 2069.0
If we take 279 away from 304, we end up with 25.
Append the next digit (7) from the dividend to 25 and continue with: 257 / 31

Going ahead to step 6:
31 can be fit into 257 8 times, resulting in a remainder of 9.
The next digit of our result is 8. 
Result so far: 20698.0
If we subtract 248 from 257, we get 9.
Since there are no more digits in the dividend, we add a zero to the remainder making it 90, and continue the process.

Going ahead to step 7:
When dividing 90 by 31, we get 2 with a remainder of 28.
Put 2 as the next digit of the answer. 
Result so far: 20698.2
If we take 62 away from 90, we end up with 28.
Since there are no more digits in the dividend, we add a zero to the remainder making it 280, and continue the process.

Moving on to step 8:
280 divided by 31 is 9 with a remainder of 1.
Write down 9 as next digit of the result. 
Result so far: 20698.29
Subtracting 279 from 280 leaves us with 1.
Since there are no more digits in the dividend, we add a zero to the remainder making it 10, and continue the process.

Moving on to step 9:
If we divide 10 by 31, we get 0 and a remainder of 10.
Write down 0 as next digit of the result. 
Result so far: 20698.29
Subtract 0 from 10 to get 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Step 10:
100 divided by 31 is 3 with a remainder of 7.
Put 3 as the next digit of the answer. 
Result so far: 20698.2903
If we take 93 away from 100, we end up with 7.
Since there are no more digits in the dividend, we add a zero to the remainder making it 70, and continue the process.

On to step 11:
If we divide 70 by 31, we get 2 and a remainder of 8.
The number 2 becomes the next digit in our result. 
Result so far: 20698.29032
Deduct 62 from 70 and we're left with 8.
Since there are no more digits in the dividend, we add a zero to the remainder making it 80, and continue the process.

On to step 12:
The number 31 fits into 80 2 times, leaving a remainder of 18.
Write down 2 as next digit of the result. 
Result so far: 20698.290322
The remainder is 18 after subtracting 62 from 80.
Since there are no more digits in the dividend, we add a zero to the remainder making it 180, and continue the process.

After the division, we end up with 20698.290322 and a remainder of 1.8e-06.