Is there a more concise formula for this? I threw this one together,
$\sum_{j=1}^{n}(\lfloor\frac{n^{j}}{j}\rfloor-\lfloor\frac{n^{j}-1}{j}\rfloor)(\lfloor\frac{j^{n}}{n}\rfloor-\lfloor\frac{j^{n}-1}{n}\rfloor)=$ number of numbers $\le n$ with same prime factors as $n$.
I can show this by proving that the term in the left parenthesis is only $1$ or $0$ depending on whether or not $j|n^{j},$ which can only happen if the factors in prime factorization of $j$ are a subset of $n$'s. The function in the parenthesis on the right is $1$ or $0$ depending on whether or not $n|j^{n},$ which only occurs if $j$ is a multiple of $rad(n)$, the product of the distinct prime factors of $n$. So, the sum counts the number of numbers $j\le n$ whose prime factorization is a subset of $n$'s and is a multiple of $rad(n)$. This leaves only those with the same factors. I give this info on the sum because people always ask, but I really just need another version.
I'm looking for a different representation of this function than the one I have created above. I can't find a formula for this anywhere. Anybody got one?
Example of the function is, for $n=24$, the prime factors of $24$ are $2$ and $3$. There are $4$ numbers with these factors $\le n,$ which are $(6,12,18,24),$ so the function at $24=4.$ Sequence is A008479 in oeis, but no formula.