Groups of order $p(p^2+1)/2$ It seems that when $p>3$ is a prime, then each group of order $p(p^2+1)/2$ is abelian as I checked by Gap for small $p$. Is it true for each $p$?
Thanks for your answers
 A: It may be worth remarking that since ${\rm gcd}(p-1,\frac{p^{2}+1}{2}) = 1,$ every group of order $\frac{p(p^{2}+1)}{2}$ has a normal subgroup of index $p$ by Burnside's normal $p$-complement theorem. On the other hand, no positive divisor of the odd integer $\frac{p^{2}+1}{2}$ (other than 1) can be congruent to 1 (mod $p$). Hence it is the case that any group of order $\frac{p(p^{2}+1)}{2}$ has a unique Sylow $p$-subgroup, so is a direct product of a group of order $p$ and a group of order $\frac{p{^2}+1}{2}.$ Whether or not the resulting group is Abelian depends only on the structure of the latter group of order $\frac{p^{2}+1}{2},$ which most answers to date have concentrated on anyway. However, it is the case that any such group (of order $\frac{p(p^{2}+1)}{2}$ ) decomposes as a direct product of two smaller non-trivial groups. I don't know if there is a characterization of integers $n$ such that every finite group of order $n$ is decomposable.
A: The smallest counterexample I could find is for $p=53$; then $(p^2+1)/2=5\times281$ and the cyclic group of order 281 has an automorphism of order 5, so the corresponding semidirect product will not be abelian.
A: To make up for my faulty comment, here's a counterexample of a somewhat different type: let $p=193$; then $(p^2+1)/2=5^3\times149$, and there is a nonabelian group of order $5^3$ (as there is of order $q^3$ for every prime $q$), so there's a nonabelian group of order $p(p^2+1)/2$. 
A: In fact, the number of primes $p$ below $x$ for which there are only abelian groups of order $p(p^2+1)/2$ is $o(\pi(x))$.  Thus for almost all primes there will be nonabelian groups of order $p(p^2+1)/2$, despite the initial numerical evidence. 
To see this, we will use the criterion provided in the answer of Robin Chapman to Finite nonabelian groups of odd order (which was pointed out by Richard Stanley in the comments above).  One needs $(n,\Phi(n))=1$ if there are only abelian groups of order $n$; here $\Phi(n)$ a variant of the Euler $\phi$-function is multiplicative with $\Phi(p^k) =p^k-1$. Also, if $n$ is cubefree (not divisible by the cube of any prime), then the condition $(n,\Phi(n))=1$ guarantees that the only groups of order $n$ are abelian.  
Suppose first that $p \equiv \pm 2 \pmod 5$.  Then $p^2+1$ is a multiple of $5$, and so if $p^2+1$ is divisible by some prime $\ell \equiv 1\pmod{20}$ then we would certainly have that $5$ divides $(n,\Phi(n))$ (writing $n=p(p^2+1)/2$).
Now the density of primes $\ell \equiv 1\pmod{20}$ is $1/8$, and a sieve argument shows that the set of primes $p\le x$ with $p\equiv \pm 2\pmod{5}$ and $p^2+1$ divisible by no such $\ell$ is $O(\pi(x) (\log x)^{-1/4})$; (two residue classes $\pmod \ell$ are forbidden for the prime $p$).  Thus almost all primes $p\equiv \pm 2 \pmod{5}$ have non-abelian groups of order $p(p^2+1)/2$.  
Next consider $p\equiv \pm 5 \pmod{13}$ so that $p^2+1 \equiv 0 \pmod{13}$, and repeat the same argument with primes $\ell \equiv 1\pmod{52}$.  And so on.  If there is a small prime $r$ with $r|(p^2+1)$ then $p^2+1$ must avoid primes $\ell \equiv 1\pmod{4r}$ and there are few such primes $p$.  Lastly it could be that $p$ is such that $p^2+1$ does not have any small prime factor $r$; but then the set of such primes $p$ also has small density.  
Optimizing this argument one can show that there are at most $O(\pi(x)/\log \log \log x)$ primes for which there are only abelian groups of order $p(p^2+1)/2$. One can also provide a lower bound of this order (but I didn't check all the details here).  
