TITLE: Number of squares in a finite group
QUESTION [13 upvotes]: This was asked at MSE but never answered.
Let $G$ be a finite group and denote by $sq(G)$ the number of squares in $G$ i.e. the number of elements in $G$ which possess a square root.  For example, if
$G$ is a group of odd order, then $sq(G) =|G|$, since each element has a square root, while at the opposite extreme, $sq(G)= 1$ when $G$ is an elementary abelian 2-group.  For the symmetric groups, the values of $sq(\mathrm{Sym}(n))$ are listed at $\,$https://oeis.org/A003483 $\,$.  Finally, we note that both the dihedral and quaternion groups of order 8 share the value $sq(G)=2$.
Questions:
1) Can $sq(G)$ be determined from information in the character table of $G$?
2) Is it true that $sq(\mathrm{Sym}(n))$ is divisible by every prime which is less than or equal to $n$ for $n>3$?

REPLY [8 votes]: The answer to Question 1) is "No" (at least when "information from the character table" is understood as only the matrix containing the values in the character table).  The following is an example of two groups with "the same" character table, but different numbers of squares. Define
$$ G_1 := \langle a_1, b_1, c_1\mid 
           a_1^2=b_1^4=c_1^8=1,\; b_1^{a_1}=b_1^{-1},\; 
           c_1^{a_1} = c_1^3,\; c_1^{b_1} = c_1^{-1}\; \rangle $$
and 
$$ G_2 := \langle a_2, b_2, c_2\mid 
           a_2^2=b_2^4=c_2^8=1,\; b_2^{a_2}=b_2^{-1},\; 
           c_2^{a_2} = c_2^{-1},\; c_2^{b_2} = c_2^3 \; \rangle .$$
Both groups are a semidirect product of $D_8 \cong \langle a_i, b_i \rangle$ acting on $C_8\cong \langle c_i \rangle$, but the action is different. (These are $\texttt{SmallGroup(64,149)}$ and $\texttt{SmallGroup(64,150)}$ from GAP's Small Groups Library.)  
Then $G_1$ has $5$ squares, namely $\langle c_1^2 \rangle \cup \{b_1^2\}$, but $G_2$ has $6$ squares, namely $\langle c_2^2 \rangle \cup\{b_2^2, b_2^2c_2^4 =(b_2c_2)^2\}$, as one sees by computing a "general square" $(a_i^k b_i^l c_i^m)^2$ in both groups.  
Finally, one can check (even without GAP) that the bijection $G_1\to G_2$ sending $a_1^ib_1^jc_1^k$ to $a_2^i b_2^j c_2 ^k$ induces a bijection between $\DeclareMathOperator{\Irr}{Irr} \Irr(G_1)$ and $\Irr(G_2)$ (the sets of irreducible characters, viewed as functions on $G_i$): The bijection between the groups yields an isomorphism $G_1/\langle c_1^4 \rangle \cong G_2/ \langle c_2^4 \rangle$, which takes care of the characters with $c_i^4 $ in the kernel. In both groups, the remaining characters are two characters of degree $4$ which vanish outside the center $\mathbf{Z}(G_i)=\langle b_i^2, c_i^4 \rangle$, so that the bijection above maps these characters onto each other: Indeed, $G_i/\langle b_i \rangle $ is isomorphic to the holomorph of $C_8$ in both cases, which has a unique faithful irred. character of degree $4$. The groups $G_1/\langle b_1^2c_1^4\rangle$ and $G_2/ \langle b_2^2 c_2^4 \rangle$ are not isomorphic, but both have a unique character of degree $4$ and central type.
(The $\chi\in \Irr(G_1/ \langle b_1^2 c_1^4 \rangle)$ with $\chi(1)=4$ has Frobenius-Schur indicator $\nu(\chi)=-1$, but the $\chi\in \Irr(G_2/\langle b_2^2c_2^4\rangle)$ with $\chi(1)=4$ has $\nu(\chi)=+1$. Such a thing must happen somewhere, as can be seen from the answer of Geoff Robinson.)