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

Let's proceed to step 1:
31 goes into 4 0 times with a remainder of 4.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we subtract 0 from 4, we get 4.
Grab the next digit (2) from the dividend, add it to 4, then carry on: 42 / 31

Step 2:
31 goes into 42 1 times with a remainder of 11.
Write down 1 as next digit of the result. 
Result so far: 1.0
Deduct 31 from 42 and we're left with 11.
Take the next digit (0) from the dividend and append it to 11, then repeat: 110 / 31

Going ahead to step 3:
31 goes into 110 3 times with a remainder of 17.
The number 3 becomes the next digit in our result. 
Result so far: 13.0
Subtract 93 from 110 to get 17.
Fetch the next digit (3) from the dividend, attach it to 17 and continue: 173 / 31

Advancing to step 4:
173 divided by 31 is 5 with a remainder of 18.
Record the quotient 5 as the next digit in the result. 
Result so far: 135.0
The remainder is 18 after subtracting 155 from 173.
Include the next digit (4) from the dividend after 18, then repeat: 184 / 31

Going ahead to step 5:
If we divide 184 by 31, we get 5 and a remainder of 29.
Put 5 as the next digit of the answer. 
Result so far: 1355.0
The remainder is 29 after subtracting 155 from 184.
Include the next digit (0) from the dividend after 29, then repeat: 290 / 31

Moving on to step 6:
If we divide 290 by 31, we get 9 and a remainder of 11.
Put 9 as the next digit of the answer. 
Result so far: 13559.0
Subtracting 279 from 290 leaves us with 11.
Since there are no more digits in the dividend, we add a zero to the remainder making it 110, and continue the process.

Moving on to step 7:
31 goes into 110 3 times with a remainder of 17.
Write down 3 as next digit of the result. 
Result so far: 13559.3
The remainder is 17 after subtracting 93 from 110.
Since there are no more digits in the dividend, we add a zero to the remainder making it 170, and continue the process.

Let's proceed to step 8:
The number 31 fits into 170 5 times, leaving a remainder of 15.
Write down 5 as next digit of the result. 
Result so far: 13559.35
If we take 155 away from 170, we end up with 15.
Since there are no more digits in the dividend, we add a zero to the remainder making it 150, and continue the process.

Step 9:
31 goes into 150 4 times with a remainder of 26.
Record the quotient 4 as the next digit in the result. 
Result so far: 13559.354
If we subtract 124 from 150, we get 26.
Since there are no more digits in the dividend, we add a zero to the remainder making it 260, and continue the process.

Step 10:
31 goes into 260 8 times with a remainder of 12.
Record the quotient 8 as the next digit in the result. 
Result so far: 13559.3548
Subtract 248 from 260 to get 12.
Since there are no more digits in the dividend, we add a zero to the remainder making it 120, and continue the process.

On to step 11:
When dividing 120 by 31, we get 3 with a remainder of 27.
The number 3 becomes the next digit in our result. 
Result so far: 13559.35483
The remainder is 27 after subtracting 93 from 120.
Since there are no more digits in the dividend, we add a zero to the remainder making it 270, and continue the process.

Moving on to step 12:
270 divided by 31 is 8 with a remainder of 22.
The number 8 becomes the next digit in our result. 
Result so far: 13559.354838
If we take 248 away from 270, we end up with 22.
Since there are no more digits in the dividend, we add a zero to the remainder making it 220, and continue the process.

On to step 13:
31 goes into 220 7 times with a remainder of 3.
The number 7 becomes the next digit in our result. 
Result so far: 13559.3548387
Subtracting 217 from 220 leaves us with 3.
Since there are no more digits in the dividend, we add a zero to the remainder making it 30, and continue the process.

Let's proceed to step 14:
31 goes into 30 0 times with a remainder of 30.
Write down 0 as next digit of the result. 
Result so far: 13559.3548387
If we take 0 away from 30, we end up with 30.
Since there are no more digits in the dividend, we add a zero to the remainder making it 300, and continue the process.

The final outcome is 13559.3548387, with a leftover of 3e-08.