We look at the division of 31791663 by 161 
The aim is to understand the frequency of 161 in 31791663.

On to step 1:
161 goes into 3 0 times with a remainder of 3.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we take 0 away from 3, we end up with 3.
Include the next digit (1) from the dividend after 3, then repeat: 31 / 161

Moving on to step 2:
When dividing 31 by 161, we get 0 with a remainder of 31.
Use 0 as the next digit of our solution. 
Result so far: 0.0
Subtract 0 from 31 to get 31.
Append the next digit (7) from the dividend to 31 and continue with: 317 / 161

Let's proceed to step 3:
161 can be fit into 317 1 times, resulting in a remainder of 156.
Write down 1 as next digit of the result. 
Result so far: 1.0
The remainder is 156 after subtracting 161 from 317.
Append the next digit (9) from the dividend to 156 and continue with: 1569 / 161

On to step 4:
1569 divided by 161 is 9 with a remainder of 120.
The number 9 becomes the next digit in our result. 
Result so far: 19.0
Deduct 1449 from 1569 and we're left with 120.
Bring next digit (1) of the dividend behind the 120 and repeat the process: 1201 / 161

Advancing to step 5:
161 can be fit into 1201 7 times, resulting in a remainder of 74.
Use 7 as the next digit of our solution. 
Result so far: 197.0
The remainder is 74 after subtracting 1127 from 1201.
Include the next digit (6) from the dividend after 74, then repeat: 746 / 161

On to step 6:
161 can be fit into 746 4 times, resulting in a remainder of 102.
Use 4 as the next digit of our solution. 
Result so far: 1974.0
The remainder is 102 after subtracting 644 from 746.
Append the next digit (6) from the dividend to 102 and continue with: 1026 / 161

Moving on to step 7:
161 can be fit into 1026 6 times, resulting in a remainder of 60.
Put 6 as the next digit of the answer. 
Result so far: 19746.0
Subtracting 966 from 1026 leaves us with 60.
Fetch the next digit (3) from the dividend, attach it to 60 and continue: 603 / 161

Going ahead to step 8:
161 can be fit into 603 3 times, resulting in a remainder of 120.
Use 3 as the next digit of our solution. 
Result so far: 197463.0
Deduct 483 from 603 and we're left with 120.
Since there are no more digits in the dividend, we add a zero to the remainder making it 1200, and continue the process.

Let's proceed to step 9:
If we divide 1200 by 161, we get 7 and a remainder of 73.
The number 7 becomes the next digit in our result. 
Result so far: 197463.7
Subtract 1127 from 1200 to get 73.
Since there are no more digits in the dividend, we add a zero to the remainder making it 730, and continue the process.

Moving on to step 10:
730 divided by 161 is 4 with a remainder of 86.
Use 4 as the next digit of our solution. 
Result so far: 197463.74
The remainder is 86 after subtracting 644 from 730.
Since there are no more digits in the dividend, we add a zero to the remainder making it 860, and continue the process.

Let's proceed to step 11:
The number 161 fits into 860 5 times, leaving a remainder of 55.
The next digit of our result is 5. 
Result so far: 197463.745
Subtract 805 from 860 to get 55.
Since there are no more digits in the dividend, we add a zero to the remainder making it 550, and continue the process.

Moving on to step 12:
161 can be fit into 550 3 times, resulting in a remainder of 67.
Record the quotient 3 as the next digit in the result. 
Result so far: 197463.7453
The remainder is 67 after subtracting 483 from 550.
Since there are no more digits in the dividend, we add a zero to the remainder making it 670, and continue the process.

Advancing to step 13:
161 goes into 670 4 times with a remainder of 26.
The number 4 becomes the next digit in our result. 
Result so far: 197463.74534
If we take 644 away from 670, we end up 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 14:
161 goes into 260 1 times with a remainder of 99.
Write down 1 as next digit of the result. 
Result so far: 197463.745341
If we take 161 away from 260, we end up with 99.
Since there are no more digits in the dividend, we add a zero to the remainder making it 990, and continue the process.

On to step 15:
161 goes into 990 6 times with a remainder of 24.
The next digit of our result is 6. 
Result so far: 197463.7453416
The remainder is 24 after subtracting 966 from 990.
Since there are no more digits in the dividend, we add a zero to the remainder making it 240, and continue the process.

Advancing to step 16:
When dividing 240 by 161, we get 1 with a remainder of 79.
The number 1 becomes the next digit in our result. 
Result so far: 197463.74534161
The remainder is 79 after subtracting 161 from 240.
Since there are no more digits in the dividend, we add a zero to the remainder making it 790, and continue the process.

The final outcome is 197463.74534161, with a leftover of 7.9e-08.