How many numbers are there such that its number of decimal digits equals to the number of its distinct prime factors

divisibilityelementary-number-theorynumber theoryprime factorizationrecreational-mathematics

Problem

A positive integer is said to be balanced if the number of its decimal digits equals the number of its distinct prime factors. For instance, $15$ is balanced, while $49$ is not. How many balanced numbers are there?

My thoughts

One digit balanced numbers are the prime ones. So, we have $4$ one digit balanced numbers.
Number of 2 digit balanced numbers = number of 2 digit numbers – number of 2 digit prime numbers – number of 2 digit prime powers = $90-21-10=59$.
We can continue doing this until we find no balanced number. But this gets messier in each step.
Edit: As in the comments, I missed many of the numbers.


Is there some easier way to solve the problem?

Best Answer

Hint:

$$2*3*5*7*11*13*17*19*23*29*31 > 10^{11}.$$

Use this to conclude that the balanced number has at most 10 distinct prime factors.


However, from here, it's seems to be tedious (and easy to miss, per the comments) but finite casework to calculate the number of $n\leq 10$ digit numbers with $n$ distinct primes.

Related Question