40857591 divided by 504 
The aim is to understand the frequency of 504 in 40857591.

Moving on to step 1:
4 divided by 504 is 0 with a remainder of 4.
Use 0 as the next digit of our solution. 
Result so far: 0.0
Subtracting 0 from 4 leaves us with 4.
Fetch the next digit (0) from the dividend, attach it to 4 and continue: 40 / 504

Moving on to step 2:
504 goes into 40 0 times with a remainder of 40.
Put 0 as the next digit of the answer. 
Result so far: 0.0
Subtract 0 from 40 to get 40.
Append the next digit (8) from the dividend to 40 and continue with: 408 / 504

Moving on to step 3:
When dividing 408 by 504, we get 0 with a remainder of 408.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
Subtracting 0 from 408 leaves us with 408.
Fetch the next digit (5) from the dividend, attach it to 408 and continue: 4085 / 504

Going ahead to step 4:
504 goes into 4085 8 times with a remainder of 53.
Use 8 as the next digit of our solution. 
Result so far: 8.0
Subtracting 4032 from 4085 leaves us with 53.
Append the next digit (7) from the dividend to 53 and continue with: 537 / 504

On to step 5:
When dividing 537 by 504, we get 1 with a remainder of 33.
Put 1 as the next digit of the answer. 
Result so far: 81.0
If we take 504 away from 537, we end up with 33.
Include the next digit (5) from the dividend after 33, then repeat: 335 / 504

Step 6:
504 can be fit into 335 0 times, resulting in a remainder of 335.
Record the quotient 0 as the next digit in the result. 
Result so far: 810.0
Deduct 0 from 335 and we're left with 335.
Append the next digit (9) from the dividend to 335 and continue with: 3359 / 504

Let's proceed to step 7:
When dividing 3359 by 504, we get 6 with a remainder of 335.
Record the quotient 6 as the next digit in the result. 
Result so far: 8106.0
The remainder is 335 after subtracting 3024 from 3359.
Bring next digit (1) of the dividend behind the 335 and repeat the process: 3351 / 504

Advancing to step 8:
504 can be fit into 3351 6 times, resulting in a remainder of 327.
Record the quotient 6 as the next digit in the result. 
Result so far: 81066.0
Subtracting 3024 from 3351 leaves us with 327.
Since there are no more digits in the dividend, we add a zero to the remainder making it 3270, and continue the process.

Let's proceed to step 9:
504 goes into 3270 6 times with a remainder of 246.
Put 6 as the next digit of the answer. 
Result so far: 81066.6
Deduct 3024 from 3270 and we're left with 246.
Since there are no more digits in the dividend, we add a zero to the remainder making it 2460, and continue the process.

Let's proceed to step 10:
504 goes into 2460 4 times with a remainder of 444.
Put 4 as the next digit of the answer. 
Result so far: 81066.64
If we subtract 2016 from 2460, we get 444.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4440, and continue the process.

Step 11:
When dividing 4440 by 504, we get 8 with a remainder of 408.
Record the quotient 8 as the next digit in the result. 
Result so far: 81066.648
Deduct 4032 from 4440 and we're left with 408.
Since there are no more digits in the dividend, we add a zero to the remainder making it 4080, and continue the process.

Let's proceed to step 12:
4080 divided by 504 is 8 with a remainder of 48.
Write down 8 as next digit of the result. 
Result so far: 81066.6488
Subtracting 4032 from 4080 leaves us with 48.
Since there are no more digits in the dividend, we add a zero to the remainder making it 480, and continue the process.

The quotient of the division is 81066.6488, and the remainder is 0.00048.