Generalization on a feature of 21

Let $$n,m \in \mathbb{N}$$ $$n=\prod_{i=1}^{r}p_{i}^{a_i}$$ where $$p_i$$ are prime factors and $$f$$ , $$g$$ and $$h$$ are the functions $$f(n,m)=\sum_{j=1}^{n}j^m$$ And $$g(n)=\sum_{i=1}^{r}a_i.p_i$$ If we put $$m=1,n=21$$ then $$g(f(21,1))=g(231)=21.$$

21 is only number satisfy $$g(f(n,1))=n$$.

proof for 21

Now let

$$h(m) = \sum_{g(f(n,m))=n}1$$

So $$h(1)=1$$.

Question

If $$m$$ have finite $$n$$ satisfied $$g(f(n,m))=n$$ then what is formula for $$h(m)$$?

Can we prove there are infinitely many $$m$$ satisfying above statement?

• What makes you suspect there is any kind of closed form for $h(m)$? – Servaes Jul 30 at 9:32
• @servaes Actually I also don't think there is any close form for $h(m)$ but maybe more interesting is, if $h(m)$ have finite value then how many such $m$ exist in which pattern – Pruthviraj Jul 30 at 10:08
• If $n$ and $n+1$ are square free $g({n(n+1)\over 2})$ is simply a sum of primes if $m$ is 1. – Roddy MacPhee Aug 5 at 15:09