The total number of these numbers is $7812$.
The number of such $n$ digit numbers $a(n)$ is:
where $a(n)=0,n\gt 10$, as mentioned by Calvin Lin.
It is sufficient to examine products of $n$-subsets of primes. That is, examine square-free numbers. Then, all solutions are numbers that are multiples of these products (possibly increment exponents of individual primes to iterate these multiples without adding excess factors) and also have correct number of digits.
I used python. I'm not sure if there is a pure mathematical approach (no computers).
from sympy.ntheory import factorint, sieve
B = 10 # number base
r = 0 # total count
for n in range(1,12):
R = set()
G = set()
a = 0
# find products of n-subsets of primes in range.
h([0 for _ in range(n+1)],n,n,B,G)
# find multiples of products that satisfy property.
for g in G:
m = 0
a = g*m
m += 1
a = g*m
if a>=B**n and a<B**(n+1):
r += len(R)
# h = try all combinations of distinct primes that won't overshoot
S += 1
S = h(S,d-1,n,B,G)
# f = evaluate the vector S containing indices of corresponding primes
for s in S:
N *= sieve[s+e+1]
e += s+1
if __name__ == "__main__":
This python code is not the fastest or prettiest approach, but simply was quick and easy to think of on the spot. Nonetheless, it gets the job done in less than few seconds.
I've also verified these results with a much slower brute force in WA Mathematica.