Solution (source code)

= Solution

Let $g$ have order $n$ in a finite group. In a complex <group representation>, its <matrix> is diagonalizable with <eigenvalues> $\zeta_j$ satisfying $\zeta_j^n=1$. If each $g^i$ with $\gcd(i,n)=1$ is conjugate to $g$, the <character of a representation> is constant on these powers. Hence
$$
\varphi(n)\chi(g)=\sum_j\sum_{\substack{1\leq i\leq n\\(i,n)=1}}\zeta_j^i\in\mathbb Z,
$$
using the stated integrality of each <Ramanujan sum>. Therefore $\chi(g)$ is rational. It is also an <algebraic integer>, being a sum of <roots of unity>; a rational <algebraic integer> is an <integer>. Thus $\boxed{\chi(g)\in\mathbb Z}$.

In a <symmetric group>, raising a <permutation> to a power coprime to its order preserves each cycle length and therefore its entire cycle type. Since cycle type determines the <conjugacy class>, the hypothesis holds, and \b[all character values of <symmetric groups> are <integers>].