A seven-digit number is to be formed using the 5 digits 1,2,3,5, and 7. Since each digit must be used at least once, the remaining 2 places can be filled by either repeating one digit two more times, or repeating two digits one more time each.
This gives rise to two cases for the frequencies of the digits:
Case 1: One digit appears 3 times and the other four digits appear 1 time each.
The number of ways to choose the digit that appears 3 times is 5C1.
The number of arrangements of these 7 digits is 3!7!.
Number of numbers formed in this case = 5C1×3!7!=5×65040=4200.
Case 2: Two digits appear 2 times each and the other three digits appear 1 time each.
The number of ways to choose the two digits that appear 2 times is 5C2.
The number of arrangements of these 7 digits is 2!2!7!.
Number of numbers formed in this case = 5C2×2!2!7!=10×45040=12600.
Total number of seven-digit numbers = 4200+12600=16800.
Answer: 16800