Question: Let a finite $G$ act on itself by conjugation, and let $N$ be the number of conjugacy classes. Find a formula for $|\mathrm{Hom}\left(\mathbb{Z}^n, G\right)|$, denoting the set of group homomorphisms from $\mathbb{Z}^n$ into $G$.
Attempt:
For $n=2$, I got that
Burnside's Lemma implies that
$$ |G|\cdot N = \sum_{g\in G} |\mathrm{Fix}\left(g\right)| $$
where
$$
\begin{aligned}
\mathrm{Fix}\left(g\right) &= \{ h\in G\;|\;g\ast h = h \} \\
&= \{h\in G\;|\; ghg^{-1} = h \} \\
&= \{ h\in G\;|\; gh = hg \}
\end{aligned}
$$
Hence
$$ \sum_{g\in G} |\mathrm{Fix}\left(g\right)| = | \{ (g,h) \in G\times G\;|\;gh = hg\} | = |\mathrm{Hom}\left(\mathbb{Z}^2, G\right)| $$
My attempt (for $n=3$):
My guess is that $|\mathrm{Hom}\left(\mathbb{Z}^n, G\right)| = |G|\cdot N^{n-1}$ but I do not know how to prove this or if it's even correct for non-abelian groups $G$. My observation is that for abelian groups $N$ = $|G|$, and for non-abelian groups, $N<|G|$. Intuitively, I would think as $n$ grows large the permutations of objects in $G\times G\times...\times G$ ($n$ times) such that they can be mapped onto by any homomorphism from an abelian group grows faster as $G$ becomes "more abelian", because of the property of homomorphisms.
Construct the function $\Phi:\mathrm{Hom}\left(\mathbb{Z}^3, G\right)\rightarrow G\times G$ where
$$ \Phi\left(\gamma\right) = \left(\gamma\left(1,0,0\right), \gamma\left(0,1,0\right), \gamma\left(0,0,1\right)\right) $$
$\Phi$ uniquely describes all homomorphisms in the set that we want. We know that this is an injective function and the image consists of ordered triples that commute so:
$$ |\mathrm{Hom}\left(\mathbb{Z}^3, G\right)| = |\{ \left(a,b,c\right)\in G\times G\times G\;|\; ab = ba, ac = ca, bc = cb\}| $$
Now consider once again $\mathrm{Fix}\left(a\right)$ under the conjugacy action. Both $b$ and $c$ must be in that set, since $a$ commutes with both $b$ and $c$. But in general that doesn't mean $b$ and $c$ commute with each other, but we require that otherwise it can't be a homomorphism.
My first attempt was to find the size of $\mathrm{Fix}\left(a\right)$ first, and then find the size of $\mathrm{Fix}\left(a\right)\cap\mathrm{Fix}\left(b\right)$. But I did not know how to do this or how it relates to the number of conjugacy classes. Not really sure how to proceed after this nor whether this is the right track.