Question on (Semi) Prime Counting Functions

I’m looking for a function counting all numbers, let’s call them power semi-primes for the moment, of the form $a^nb^m\leq t$. $a,b$ are primes and might be equal.

Edit: $n$ and $m$ are fixed.

I think this is related to the standard semi-prime counting function $\pi_2(t)$, since all semi-primes $ab$ can be mapped to $a^nb^m$.

What I got so far, is the following: Since $\pi_1(t^{1/n})$ counts the $n$th power of primes below $t$, I conclude that, if $n=m$, $\pi_2(t^{1/n})$ counts the number of power semi-primes $(ab)^n$ less than $t$.

But what if $n\neq m$? How does the argument of $\pi_2(\cdot)$ look like in this case?

I tried $\pi_2(t^{1/\sqrt{(n+m)}})$, that to my own surprise worked well for a restricted set or primes ($a,b<10000$) and a few values of $t$(<1000), $n$ and $m$. Unfortunately, the exponent of $t$ doesn’t match in the case $n=m$, since $1/n\neq 1/\sqrt{2n}$, so I assume that, this is nothing but mere accidential coincidence. Additional question: Can anyone disprove this?

Solutions Collecting From Web of "Question on (Semi) Prime Counting Functions"

Suppose without loss of generality that $m<n$. Then we can write the number of integers of the form $p^m q^n$ ($p,q$ prime) less than $x$ as
$$
\sum_{q\le x^{1/n}} \sum_{p<(x/q^n)^{1/m}} 1 = \sum_{q\le x^{1/n}} \pi\bigg( \Big( \frac x{q^n} \Big)^{1/m} \bigg) \approx \frac{x^{1/m}}{\log x^{1/m}} \sum_{q\le x^{1/n}} \frac1{q^{n/m}} \sim C_{n,m} \frac{x^{1/m}}{\log x}
$$
for some constant $C_{n,m}$, since the last sum converges. In other words, integers of the form $p^m q^n$ are not that much more numerous than integers of the form $p^m 2^n$.

(The $\approx$ step above can be made rigorous by summing only over $q<x^{1/(m+n)}$ say, and dealing with the other integers in the sum by first summing over $p$ instead of over $q$.)

Count the prime powers up to t; this is pretty easy (list the primes up to t, then the primes up to $\sqrt t$ squared, then the prime up to $\sqrt[3]t$ cubed, etc.).

Now all you need is to count the numbers of the form $p^nq^m$ with $p<q$ prime and $m,n>0.$ Loop over the prime powers $p^n\le t/2$ (just like the above), and for each count the prime powers (with primes $q>p$) up to $\lfloor t/p^n\rfloor,$ just like the first step.