We divide 161790 by 40
The aim is to understand the frequency of 40 in 161790.

Moving on to step 1:
If we divide 1 by 40, we get 0 and a remainder of 1.
The next digit of our result is 0. 
Result so far: 0.0
Subtracting 0 from 1 leaves us with 1.
Grab the next digit (6) from the dividend, add it to 1, then carry on: 16 / 40

Moving on to step 2:
The number 40 fits into 16 0 times, leaving a remainder of 16.
Write down 0 as next digit of the result. 
Result so far: 0.0
The remainder is 16 after subtracting 0 from 16.
Grab the next digit (1) from the dividend, add it to 16, then carry on: 161 / 40

Step 3:
The number 40 fits into 161 4 times, leaving a remainder of 1.
The next digit of our result is 4. 
Result so far: 4.0
The remainder is 1 after subtracting 160 from 161.
Fetch the next digit (7) from the dividend, attach it to 1 and continue: 17 / 40

Going ahead to step 4:
When dividing 17 by 40, we get 0 with a remainder of 17.
The next digit of our result is 0. 
Result so far: 40.0
If we take 0 away from 17, we end up with 17.
Include the next digit (9) from the dividend after 17, then repeat: 179 / 40

Going ahead to step 5:
40 can be fit into 179 4 times, resulting in a remainder of 19.
Use 4 as the next digit of our solution. 
Result so far: 404.0
Subtracting 160 from 179 leaves us with 19.
Fetch the next digit (0) from the dividend, attach it to 19 and continue: 190 / 40

Let's proceed to step 6:
If we divide 190 by 40, we get 4 and a remainder of 30.
Use 4 as the next digit of our solution. 
Result so far: 4044.0
Subtracting 160 from 190 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.

Step 7:
The number 40 fits into 300 7 times, leaving a remainder of 20.
Record the quotient 7 as the next digit in the result. 
Result so far: 4044.7
The remainder is 20 after subtracting 280 from 300.
Since there are no more digits in the dividend, we add a zero to the remainder making it 200, and continue the process.

Moving on to step 8:
40 can be fit into 200 5 times, resulting in a remainder of 0.
The next digit of our result is 5. 
Result so far: 4044.75
If we subtract 200 from 200, we get 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Going ahead to step 9:
40 goes into 0 0 times with a remainder of 0.
The next digit of our result is 0. 
Result so far: 4044.75
The remainder is 0 after subtracting 0 from 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Let's proceed to step 10:
0 divided by 40 is 0 with a remainder of 0.
Use 0 as the next digit of our solution. 
Result so far: 4044.75
If we subtract 0 from 0, we get 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

In conclusion, the division gives 4044.75 with a balance of 0.0.