We divide 317940 by 31
The aim is to understand the frequency of 31 in 317940.

On to step 1:
3 divided by 31 is 0 with a remainder of 3.
Write down 0 as next digit of the result. 
Result so far: 0.0
Subtract 0 from 3 to get 3.
Include the next digit (1) from the dividend after 3, then repeat: 31 / 31

Going ahead to step 2:
When dividing 31 by 31, we get 1 with a remainder of 0.
Write down 1 as next digit of the result. 
Result so far: 1.0
Subtracting 31 from 31 leaves us with 0.
Take the next digit (7) from the dividend and append it to 0, then repeat: 7 / 31

Going ahead to step 3:
31 goes into 7 0 times with a remainder of 7.
Record the quotient 0 as the next digit in the result. 
Result so far: 10.0
If we subtract 0 from 7, we get 7.
Take the next digit (9) from the dividend and append it to 7, then repeat: 79 / 31

On to step 4:
The number 31 fits into 79 2 times, leaving a remainder of 17.
Record the quotient 2 as the next digit in the result. 
Result so far: 102.0
Deduct 62 from 79 and we're left with 17.
Include the next digit (4) from the dividend after 17, then repeat: 174 / 31

Step 5:
If we divide 174 by 31, we get 5 and a remainder of 19.
Record the quotient 5 as the next digit in the result. 
Result so far: 1025.0
Deduct 155 from 174 and we're left with 19.
Append the next digit (0) from the dividend to 19 and continue with: 190 / 31

Let's proceed to step 6:
31 goes into 190 6 times with a remainder of 4.
The next digit of our result is 6. 
Result so far: 10256.0
If we subtract 186 from 190, we get 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

On to step 7:
When dividing 40 by 31, we get 1 with a remainder of 9.
Write down 1 as next digit of the result. 
Result so far: 10256.1
If we subtract 31 from 40, 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.

Let's proceed to step 8:
The number 31 fits into 90 2 times, leaving a remainder of 28.
Write down 2 as next digit of the result. 
Result so far: 10256.12
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.

On to step 9:
The number 31 fits into 280 9 times, leaving a remainder of 1.
Put 9 as the next digit of the answer. 
Result so far: 10256.129
If we subtract 279 from 280, we get 1.
Since there are no more digits in the dividend, we add a zero to the remainder making it 10, and continue the process.

Step 10:
If we divide 10 by 31, we get 0 and a remainder of 10.
The number 0 becomes the next digit in our result. 
Result so far: 10256.129
Subtracting 0 from 10 leaves us with 10.
Since there are no more digits in the dividend, we add a zero to the remainder making it 100, and continue the process.

Moving on to step 11:
31 can be fit into 100 3 times, resulting in a remainder of 7.
Put 3 as the next digit of the answer. 
Result so far: 10256.12903
Subtracting 93 from 100 leaves us 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.

Going ahead to step 12:
The number 31 fits into 70 2 times, leaving a remainder of 8.
The next digit of our result is 2. 
Result so far: 10256.129032
If we take 62 away from 70, we end up 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.

Step 13:
80 divided by 31 is 2 with a remainder of 18.
Write down 2 as next digit of the result. 
Result so far: 10256.1290322
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.

In conclusion, the division gives 10256.1290322 with a balance of 1.8e-07.