We look at the division of 398745 by 7 
The aim is to understand the frequency of 7 in 398745.

Let's proceed to step 1:
7 goes into 3 0 times with a remainder of 3.
Record the quotient 0 as the next digit in the result. 
Result so far: 0.0
The remainder is 3 after subtracting 0 from 3.
Include the next digit (9) from the dividend after 3, then repeat: 39 / 7

On to step 2:
If we divide 39 by 7, we get 5 and a remainder of 4.
The number 5 becomes the next digit in our result. 
Result so far: 5.0
Subtracting 35 from 39 leaves us with 4.
Append the next digit (8) from the dividend to 4 and continue with: 48 / 7

Moving on to step 3:
7 can be fit into 48 6 times, resulting in a remainder of 6.
The next digit of our result is 6. 
Result so far: 56.0
Subtract 42 from 48 to get 6.
Grab the next digit (7) from the dividend, add it to 6, then carry on: 67 / 7

Step 4:
If we divide 67 by 7, we get 9 and a remainder of 4.
The number 9 becomes the next digit in our result. 
Result so far: 569.0
If we subtract 63 from 67, we get 4.
Take the next digit (4) from the dividend and append it to 4, then repeat: 44 / 7

Advancing to step 5:
When dividing 44 by 7, we get 6 with a remainder of 2.
The number 6 becomes the next digit in our result. 
Result so far: 5696.0
Subtracting 42 from 44 leaves us with 2.
Grab the next digit (5) from the dividend, add it to 2, then carry on: 25 / 7

Moving on to step 6:
7 can be fit into 25 3 times, resulting in a remainder of 4.
Put 3 as the next digit of the answer. 
Result so far: 56963.0
The remainder is 4 after subtracting 21 from 25.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

Advancing to step 7:
When dividing 40 by 7, we get 5 with a remainder of 5.
Use 5 as the next digit of our solution. 
Result so far: 56963.5
If we take 35 away from 40, we end up with 5.
Since there are no more digits in the dividend, we add a zero to the remainder making it 50, and continue the process.

Let's proceed to step 8:
When dividing 50 by 7, we get 7 with a remainder of 1.
Record the quotient 7 as the next digit in the result. 
Result so far: 56963.57
Deduct 49 from 50 and we're left with 1.
Since there are no more digits in the dividend, we add a zero to the remainder making it 10, and continue the process.

Moving on to step 9:
The number 7 fits into 10 1 times, leaving a remainder of 3.
The number 1 becomes the next digit in our result. 
Result so far: 56963.571
Deduct 7 from 10 and we're left with 3.
Since there are no more digits in the dividend, we add a zero to the remainder making it 30, and continue the process.

Advancing to step 10:
7 goes into 30 4 times with a remainder of 2.
Put 4 as the next digit of the answer. 
Result so far: 56963.5714
If we take 28 away from 30, we end up with 2.
Since there are no more digits in the dividend, we add a zero to the remainder making it 20, and continue the process.

Let's proceed to step 11:
7 can be fit into 20 2 times, resulting in a remainder of 6.
Put 2 as the next digit of the answer. 
Result so far: 56963.57142
If we subtract 14 from 20, we get 6.
Since there are no more digits in the dividend, we add a zero to the remainder making it 60, and continue the process.

On to step 12:
60 divided by 7 is 8 with a remainder of 4.
Put 8 as the next digit of the answer. 
Result so far: 56963.571428
Subtracting 56 from 60 leaves us with 4.
Since there are no more digits in the dividend, we add a zero to the remainder making it 40, and continue the process.

On to step 13:
The number 7 fits into 40 5 times, leaving a remainder of 5.
Use 5 as the next digit of our solution. 
Result so far: 56963.5714285
Deduct 35 from 40 and we're left with 5.
Since there are no more digits in the dividend, we add a zero to the remainder making it 50, and continue the process.

On to step 14:
The number 7 fits into 50 7 times, leaving a remainder of 1.
Record the quotient 7 as the next digit in the result. 
Result so far: 56963.57142857
Deduct 49 from 50 and we're left with 1.
Since there are no more digits in the dividend, we add a zero to the remainder making it 10, and continue the process.

Our division results in 56963.57142857 with a remaining 1e-09.