Let's divide 1005161 by 542
The aim is to understand the frequency of 542 in 1005161.

Going ahead to step 1:
542 can be fit into 1 0 times, resulting in a remainder of 1.
Put 0 as the next digit of the answer. 
Result so far: 0.0
The remainder is 1 after subtracting 0 from 1.
Take the next digit (0) from the dividend and append it to 1, then repeat: 10 / 542

Moving on to step 2:
542 can be fit into 10 0 times, resulting in a remainder of 10.
Write down 0 as next digit of the result. 
Result so far: 0.0
If we subtract 0 from 10, we get 10.
Include the next digit (0) from the dividend after 10, then repeat: 100 / 542

Step 3:
If we divide 100 by 542, we get 0 and a remainder of 100.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we take 0 away from 100, we end up with 100.
Fetch the next digit (5) from the dividend, attach it to 100 and continue: 1005 / 542

Moving on to step 4:
1005 divided by 542 is 1 with a remainder of 463.
Record the quotient 1 as the next digit in the result. 
Result so far: 1.0
If we take 542 away from 1005, we end up with 463.
Grab the next digit (1) from the dividend, add it to 463, then carry on: 4631 / 542

Moving on to step 5:
When dividing 4631 by 542, we get 8 with a remainder of 295.
Use 8 as the next digit of our solution. 
Result so far: 18.0
Deduct 4336 from 4631 and we're left with 295.
Take the next digit (6) from the dividend and append it to 295, then repeat: 2956 / 542

Step 6:
542 goes into 2956 5 times with a remainder of 246.
The number 5 becomes the next digit in our result. 
Result so far: 185.0
Subtract 2710 from 2956 to get 246.
Include the next digit (1) from the dividend after 246, then repeat: 2461 / 542

On to step 7:
The number 542 fits into 2461 4 times, leaving a remainder of 293.
The number 4 becomes the next digit in our result. 
Result so far: 1854.0
The remainder is 293 after subtracting 2168 from 2461.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2930, and continue the process.

Let's proceed to step 8:
When dividing 2930 by 542, we get 5 with a remainder of 220.
Record the quotient 5 as the next digit in the result. 
Result so far: 1854.5
Subtract 2710 from 2930 to get 220.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2200, and continue the process.

On to step 9:
If we divide 2200 by 542, we get 4 and a remainder of 32.
The next digit of our result is 4. 
Result so far: 1854.54
The remainder is 32 after subtracting 2168 from 2200.
Since there are no more digits in the dividend, we add a zero to the remainder making it 320, and continue the process.

On to step 10:
If we divide 320 by 542, we get 0 and a remainder of 320.
Put 0 as the next digit of the answer. 
Result so far: 1854.54
Deduct 0 from 320 and we're left with 320.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3200, and continue the process.

Moving on to step 11:
542 can be fit into 3200 5 times, resulting in a remainder of 490.
The next digit of our result is 5. 
Result so far: 1854.5405
Deduct 2710 from 3200 and we're left with 490.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4900, and continue the process.

Moving on to step 12:
542 goes into 4900 9 times with a remainder of 22.
Record the quotient 9 as the next digit in the result. 
Result so far: 1854.54059
The remainder is 22 after subtracting 4878 from 4900.
Since there are no more digits in the dividend, we add a zero to the remainder making it 220, and continue the process.

Moving on to step 13:
The number 542 fits into 220 0 times, leaving a remainder of 220.
The next digit of our result is 0. 
Result so far: 1854.54059
If we take 0 away from 220, we end up with 220.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2200, and continue the process.

Going ahead to step 14:
542 can be fit into 2200 4 times, resulting in a remainder of 32.
Put 4 as the next digit of the answer. 
Result so far: 1854.5405904
Subtract 2168 from 2200 to get 32.
Since there are no more digits in the dividend, we add a zero to the remainder making it 320, and continue the process.

Step 15:
The number 542 fits into 320 0 times, leaving a remainder of 320.
The number 0 becomes the next digit in our result. 
Result so far: 1854.5405904
Subtract 0 from 320 to get 320.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3200, and continue the process.

The final result is 1854.5405904 with a remainder of 3.2e-07.