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

Going ahead to step 1:
31 can be fit into 9 0 times, resulting in a remainder of 9.
The next digit of our result is 0. 
Result so far: 0.0
Deduct 0 from 9 and we're left with 9.
Take the next digit (9) from the dividend and append it to 9, then repeat: 99 / 31

Moving on to step 2:
31 goes into 99 3 times with a remainder of 6.
Record the quotient 3 as the next digit in the result. 
Result so far: 3.0
If we subtract 93 from 99, we get 6.
Take the next digit (6) from the dividend and append it to 6, then repeat: 66 / 31

Let's proceed to step 3:
31 goes into 66 2 times with a remainder of 4.
Record the quotient 2 as the next digit in the result. 
Result so far: 32.0
If we subtract 62 from 66, we get 4.
Fetch the next digit (3) from the dividend, attach it to 4 and continue: 43 / 31

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

Moving on to step 5:
The number 31 fits into 127 4 times, leaving a remainder of 3.
Write down 4 as next digit of the result. 
Result so far: 3214.0
If we subtract 124 from 127, we get 3.
Take the next digit (7) from the dividend and append it to 3, then repeat: 37 / 31

Advancing to step 6:
31 goes into 37 1 times with a remainder of 6.
Put 1 as the next digit of the answer. 
Result so far: 32141.0
Subtract 31 from 37 to get 6.
Since there are no more digits in the dividend, we add a zero to the remainder making it 60, and continue the process.

Advancing to step 7:
31 goes into 60 1 times with a remainder of 29.
Write down 1 as next digit of the result. 
Result so far: 32141.1
The remainder is 29 after subtracting 31 from 60.
Since there are no more digits in the dividend, we add a zero to the remainder making it 290, and continue the process.

Let's proceed to step 8:
31 can be fit into 290 9 times, resulting in a remainder of 11.
Record the quotient 9 as the next digit in the result. 
Result so far: 32141.19
If we take 279 away from 290, we end up 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.

Step 9:
When dividing 110 by 31, we get 3 with a remainder of 17.
Write down 3 as next digit of the result. 
Result so far: 32141.193
If we take 93 away from 110, we end up with 17.
Since there are no more digits in the dividend, we add a zero to the remainder making it 170, and continue the process.

Step 10:
31 goes into 170 5 times with a remainder of 15.
Put 5 as the next digit of the answer. 
Result so far: 32141.1935
Deduct 155 from 170 and we're left 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.

Moving on to step 11:
31 goes into 150 4 times with a remainder of 26.
Use 4 as the next digit of our solution. 
Result so far: 32141.19354
Subtract 124 from 150 to 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.

Advancing to step 12:
The number 31 fits into 260 8 times, leaving a remainder of 12.
Use 8 as the next digit of our solution. 
Result so far: 32141.193548
Subtracting 248 from 260 leaves us with 12.
Since there are no more digits in the dividend, we add a zero to the remainder making it 120, and continue the process.

Advancing to step 13:
120 divided by 31 is 3 with a remainder of 27.
The number 3 becomes the next digit in our result. 
Result so far: 32141.1935483
If we subtract 93 from 120, we get 27.
Since there are no more digits in the dividend, we add a zero to the remainder making it 270, and continue the process.

On to step 14:
When dividing 270 by 31, we get 8 with a remainder of 22.
Write down 8 as next digit of the result. 
Result so far: 32141.19354838
The remainder is 22 after subtracting 248 from 270.
Since there are no more digits in the dividend, we add a zero to the remainder making it 220, and continue the process.

The final result is 32141.19354838 with a remainder of 2.2e-08.