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

Let's proceed to step 1:
If we divide 7 by 31, we get 0 and a remainder of 7.
Write down 0 as next digit of the result. 
Result so far: 0.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

Advancing to step 2:
79 divided by 31 is 2 with a remainder of 17.
Use 2 as the next digit of our solution. 
Result so far: 2.0
The remainder is 17 after subtracting 62 from 79.
Take the next digit (7) from the dividend and append it to 17, then repeat: 177 / 31

On to step 3:
When dividing 177 by 31, we get 5 with a remainder of 22.
Record the quotient 5 as the next digit in the result. 
Result so far: 25.0
If we subtract 155 from 177, we get 22.
Take the next digit (2) from the dividend and append it to 22, then repeat: 222 / 31

Advancing to step 4:
31 goes into 222 7 times with a remainder of 5.
Use 7 as the next digit of our solution. 
Result so far: 257.0
If we take 217 away from 222, we end up with 5.
Fetch the next digit (8) from the dividend, attach it to 5 and continue: 58 / 31

Step 5:
When dividing 58 by 31, we get 1 with a remainder of 27.
Use 1 as the next digit of our solution. 
Result so far: 2571.0
If we take 31 away from 58, we end up with 27.
Include the next digit (4) from the dividend after 27, then repeat: 274 / 31

Advancing to step 6:
The number 31 fits into 274 8 times, leaving a remainder of 26.
The next digit of our result is 8. 
Result so far: 25718.0
Deduct 248 from 274 and we're left with 26.
Since there are no more digits in the dividend, we add a zero to the remainder making it 260, and continue the process.

Moving on to step 7:
If we divide 260 by 31, we get 8 and a remainder of 12.
The number 8 becomes the next digit in our result. 
Result so far: 25718.8
Deduct 248 from 260 and we're left 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.

On to step 8:
31 goes into 120 3 times with a remainder of 27.
Put 3 as the next digit of the answer. 
Result so far: 25718.83
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.

Advancing to step 9:
If we divide 270 by 31, we get 8 and a remainder of 22.
Write down 8 as next digit of the result. 
Result so far: 25718.838
Subtract 248 from 270 to get 22.
Since there are no more digits in the dividend, we add a zero to the remainder making it 220, and continue the process.

Let's proceed to step 10:
When dividing 220 by 31, we get 7 with a remainder of 3.
Put 7 as the next digit of the answer. 
Result so far: 25718.8387
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.

Moving on to step 11:
The number 31 fits into 30 0 times, leaving a remainder of 30.
The number 0 becomes the next digit in our result. 
Result so far: 25718.8387
Subtracting 0 from 30 leaves us 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.

Advancing to step 12:
The number 31 fits into 300 9 times, leaving a remainder of 21.
Record the quotient 9 as the next digit in the result. 
Result so far: 25718.838709
The remainder is 21 after subtracting 279 from 300.
Since there are no more digits in the dividend, we add a zero to the remainder making it 210, and continue the process.

Moving on to step 13:
31 goes into 210 6 times with a remainder of 24.
Record the quotient 6 as the next digit in the result. 
Result so far: 25718.8387096
Subtract 186 from 210 to get 24.
Since there are no more digits in the dividend, we add a zero to the remainder making it 240, and continue the process.

Going ahead to step 14:
240 divided by 31 is 7 with a remainder of 23.
The next digit of our result is 7. 
Result so far: 25718.83870967
Subtracting 217 from 240 leaves us with 23.
Since there are no more digits in the dividend, we add a zero to the remainder making it 230, and continue the process.

The final result is 25718.83870967 with a remainder of 2.3e-08.