Nilpotency of a group by looking at orders of elements For any finite group $G$, let
$$\theta(G) := \sum_{g \in G} \frac{o(g)}{\phi(o(g))},$$
where $o(g)$ denotes the order of the element $g$ in $G$, and where $\phi$ is the Euler totient function.
It is not too hard to see that if $G$ is nilpotent, then $\theta(G)$ is in fact equal to $\sigma(|G|)$, i.e. the sum of the divisors of $|G|$. However, it seems that $\theta(G)$ is always less than or equal to $\sigma(|G|)$, and that equality holds if and only if $G$ is nilpotent.
My question is twofold: (1) Is this claim true? (2) What kind of "natural" properties of groups (such as nilpotency) are there that can be checked by only looking at the orders of the elements of the group?
 A: (I post this as an answer, since I don't want to enter the below math into the comment box. It answers Tom de Medt's question on my comment to Robert Guralnick's answer.)
Nilpotency can be checked by looking only at the orders of elements: Write $e_G(k)$ for the number of elements of order $k$ in $G$. As I remarked in that comment, nilpotency of $G$ implies multiplicity of $e_G$ on coprime elements, since $G$ is the direct product of the Sylow subgroups.
Indeed, one can make somewhat more precise statements: Let $p$ be a prime and $|G|_p$ the $p$-part of $|G|$, and note that
$$ \sum_{i\geq 0} e_G(p^i) \geq | G |_p ,$$
with equality if and only if there is only one Sylow $p$-subgroup of $G$. So one can tell from the orders whether $G$ has a normal Sylow $p$-subgroup. $G$ is nilpotent iff all Sylow subgroups are normal.
Looking at the multiplicity of $e_G$ was perhaps more complicated than necessary, but here is a justification of the assertion from my comment: If $e_G$ is multiplicative, then
$$ |G| = \prod_{p } |G|_p
        \leq \prod_{p } \sum_{i\geq 0} e_G(p^i)
        = \sum_{k\geq 0} e_G(k) = |G|, $$
and thus the "$\leq$" must be a "$=$", which again implies all Sylow $p$-subgroups are normal.
A: Nilpotency seems to be the only easy case.  John Thompson asked many years ago whether one could tell if a finite group is solvable by the orders of its elements and as far as I know this is still open (equivalently, embed the two groups H and K of order n into G:=Sym(n) via the regular representation.  Having the same collection of orders (as a multiset) is exactly saying that the induced characters from the trivial representation of H or K to G are the same.   
I think also that one can prove claim (1) at least for G solvable by taking a minimal
normal subgroup N of G that is an elementary abelian p-group and showing that this function
over a coset gN is at most the same as for a nilpotent group and if some element in the coset has order prime to p, then this will always be less than the answer in a nilpotent group as long as g does not commute with N.  This shows that a minimal counterexample would have trivial Fitting subgroup and perhaps one can reduce to the case of simple groups.   At the moment, I do not see how to show this inequality for simple groups.  
