There is finitely generated group $G$ which I don't know. For every finite group $H$ I can think of, I know the number of homomorphisms $G \to H$ up to conjugation. (By this I mean that two homomorphisms $\phi_1$ and $\phi_2$ are being considered equivalent if there is a $h \in H$ such that $\phi_1(g)h = h\phi_2(g)$ for all $g \in G$.)
Given these numbers, do I have enough information to recover $G$?
Edit: The question is motivated from physics. A flat $H$-connection on a manifold $M$ is a homomorphism $\pi_1(M) \to H$ and a gauge transformation is a conjugation. So I'm interested whether I can recover the fundamental group by counting equivalence classes of connections, for arbitrary finite gauge groups.
Edit 2: It would be interesting as well if we count the number of homomorphisms without taking the equivalence by conjugation into account.
No. If $G$ is infinite and simple, then any homomorphism $f:G \to H$ for $H$ finite must be trivial; otherwise, $\ker f$ would be a proper normal subgroup of $G$. Such (finitely-generated) groups exist, though their construction is nontrivial; look at the Thompson groups, for example, or one of Higman's examples.