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

Let's proceed to step 1:
31 goes into 5 0 times with a remainder of 5.
Use 0 as the next digit of our solution. 
Result so far: 0.0
The remainder is 5 after subtracting 0 from 5.
Append the next digit (6) from the dividend to 5 and continue with: 56 / 31

Moving on to step 2:
The number 31 fits into 56 1 times, leaving a remainder of 25.
The number 1 becomes the next digit in our result. 
Result so far: 1.0
If we take 31 away from 56, we end up with 25.
Grab the next digit (1) from the dividend, add it to 25, then carry on: 251 / 31

Going ahead to step 3:
If we divide 251 by 31, we get 8 and a remainder of 3.
Record the quotient 8 as the next digit in the result. 
Result so far: 18.0
If we take 248 away from 251, we end up with 3.
Bring next digit (5) of the dividend behind the 3 and repeat the process: 35 / 31

Going ahead to step 4:
When dividing 35 by 31, we get 1 with a remainder of 4.
The next digit of our result is 1. 
Result so far: 181.0
Subtract 31 from 35 to get 4.
Take the next digit (3) from the dividend and append it to 4, then repeat: 43 / 31

Advancing to step 5:
When dividing 43 by 31, we get 1 with a remainder of 12.
Use 1 as the next digit of our solution. 
Result so far: 1811.0
Deduct 31 from 43 and we're left with 12.
Bring next digit (1) of the dividend behind the 12 and repeat the process: 121 / 31

Advancing to step 6:
31 can be fit into 121 3 times, resulting in a remainder of 28.
The number 3 becomes the next digit in our result. 
Result so far: 18113.0
Deduct 93 from 121 and we're left 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.

Step 7:
If we divide 280 by 31, we get 9 and a remainder of 1.
Record the quotient 9 as the next digit in the result. 
Result so far: 18113.9
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.

Moving on to step 8:
If we divide 10 by 31, we get 0 and a remainder of 10.
Record the quotient 0 as the next digit in the result. 
Result so far: 18113.9
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.

Let's proceed to step 9:
When dividing 100 by 31, we get 3 with a remainder of 7.
The number 3 becomes the next digit in our result. 
Result so far: 18113.903
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.

Moving on to step 10:
31 goes into 70 2 times with a remainder of 8.
Put 2 as the next digit of the answer. 
Result so far: 18113.9032
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.

Going ahead to step 11:
31 can be fit into 80 2 times, resulting in a remainder of 18.
The number 2 becomes the next digit in our result. 
Result so far: 18113.90322
If we subtract 62 from 80, we get 18.
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 18113.90322 and a remainder of 1.8e-05.