50777 divided by 40 
The aim is to understand the frequency of 40 in 50777.

On to step 1:
40 goes into 5 0 times with a remainder of 5.
Use 0 as the next digit of our solution. 
Result so far: 0.0
If we take 0 away from 5, we end up with 5.
Include the next digit (0) from the dividend after 5, then repeat: 50 / 40

On to step 2:
40 can be fit into 50 1 times, resulting in a remainder of 10.
The number 1 becomes the next digit in our result. 
Result so far: 1.0
Subtract 40 from 50 to get 10.
Append the next digit (7) from the dividend to 10 and continue with: 107 / 40

Going ahead to step 3:
40 goes into 107 2 times with a remainder of 27.
Write down 2 as next digit of the result. 
Result so far: 12.0
Deduct 80 from 107 and we're left with 27.
Include the next digit (7) from the dividend after 27, then repeat: 277 / 40

Let's proceed to step 4:
The number 40 fits into 277 6 times, leaving a remainder of 37.
The number 6 becomes the next digit in our result. 
Result so far: 126.0
Subtract 240 from 277 to get 37.
Include the next digit (7) from the dividend after 37, then repeat: 377 / 40

Advancing to step 5:
If we divide 377 by 40, we get 9 and a remainder of 17.
Put 9 as the next digit of the answer. 
Result so far: 1269.0
If we subtract 360 from 377, we get 17.
Since there are no more digits in the dividend, we add a zero to the remainder making it 170, and continue the process.

Going ahead to step 6:
The number 40 fits into 170 4 times, leaving a remainder of 10.
Record the quotient 4 as the next digit in the result. 
Result so far: 1269.4
If we take 160 away from 170, we end up 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.

Advancing to step 7:
When dividing 100 by 40, we get 2 with a remainder of 20.
Put 2 as the next digit of the answer. 
Result so far: 1269.42
Deduct 80 from 100 and we're left with 20.
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:
The number 40 fits into 200 5 times, leaving a remainder of 0.
Record the quotient 5 as the next digit in the result. 
Result so far: 1269.425
Deduct 200 from 200 and we're left with 0.
Since there are no more digits in the dividend, we add a zero to the remainder making it 0, and continue the process.

Step 9:
0 divided by 40 is 0 with a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 1269.425
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.

Step 10:
The number 40 fits into 0 0 times, leaving a remainder of 0.
Write down 0 as next digit of the result. 
Result so far: 1269.425
If we take 0 away from 0, we end up with 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 1269.425 with a balance of 0.0.